diff --git a/Jenkinsfile b/Jenkinsfile index 24614f1..5f34bf9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,6 +29,21 @@ spec: - mountPath: "/etc/localtime" name: "volume-2" readOnly: false + - name: kubectl + image: kubersphere/kubectl:v1.22.0 + imagePullPolicy: IfNotPresent + tty: true + volumeMounts: + - mountPath: "/etc/localtime" + name: "volume-2" + readOnly: false + - mountPath: "/var/run/docker.sock" + name: "volume-docker" + readOnly: false + - mountPath: "/.kube/config" + subPath: config + name: "kubeconfig" + readOnly: false volumes: - name: volume-maven-repo emptyDir: {} @@ -48,6 +63,14 @@ spec: } } stages { + stage('Check Kubernetes ENV') { + steps { + container(name: 'kubectl', shell: 'echo') { + sh 'kubectl get pod -A' + } + + } + } stage('构建镜像及检查kubernetes环境') { parallel { stage('构建镜像') {