Skip to content
Snippets Groups Projects

Fix Jenkins not rolling out to cluster

1 file
+ 52
0
Compare changes
  • Side-by-side
  • Inline
+ 52
0
@@ -147,6 +147,58 @@ pipeline {
}
}
}
stage('Deploy to cluster') {
agent {
kubernetes {
label 'kubedeploy-agent'
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: kubectl
image: eclipsefdn/kubectl:okd-c1
command:
- cat
tty: true
resources:
limits:
cpu: 1
memory: 1Gi
volumeMounts:
- mountPath: "/home/default/.kube"
name: "dot-kube"
readOnly: false
- name: jnlp
resources:
limits:
cpu: 1
memory: 1Gi
volumes:
- name: "dot-kube"
emptyDir: {}
'''
}
}
when {
anyOf {
environment name: 'ENVIRONMENT', value: 'production'
environment name: 'ENVIRONMENT', value: 'staging'
}
}
steps {
container('kubectl') {
updateContainerImage([
namespace: "${env.NAMESPACE}",
selector: "app=${env.APP_NAME},environment=${env.ENVIRONMENT}",
containerName: "${env.CONTAINER_NAME}",
newImageRef: "${env.IMAGE_NAME}:${env.TAG_NAME}"
])
}
}
}
}
post {
Loading