adding kujbernetes
This commit is contained in:
parent
99f6010e01
commit
d06e3fb7f8
|
|
@ -81,36 +81,10 @@ spec:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Testing Network to Kubernetes') {
|
|
||||||
steps {
|
|
||||||
container('kubectl') {
|
|
||||||
withCredentials([string(credentialsId: 'a03aac83-cfb5-462c-af9e-c0904ea4be9b', variable: 'KUBE_TOKEN')]) {
|
|
||||||
sh '''
|
|
||||||
kubectl --server=https://console.kube.winteraccess.id/api/endpoints/1/kubernetes \
|
|
||||||
--token=$KUBE_TOKEN \
|
|
||||||
--kubeconfig=/dev/null \
|
|
||||||
get nodes
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Debug Kubernetes') {
|
|
||||||
steps {
|
|
||||||
container('kubectl') {
|
|
||||||
sh '''
|
|
||||||
kubectl get pods --all-namespaces
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
stage('Deploy to Kubernetes') {
|
stage('Deploy to Kubernetes') {
|
||||||
steps {
|
steps {
|
||||||
container('kubectl') { // ✅ Ensures `kubectl` runs in the correct container
|
container('kubectl') { // ✅ Runs kubectl inside the correct container
|
||||||
withKubeConfig([credentialsId: "${KUBE_CONFIG_ID}"]) {
|
withKubeConfig([credentialsId: '1c8bd8d9-1590-468c-afc7-24495d4330dc']) { // ✅ Uses the Jenkins credential
|
||||||
sh '''
|
sh '''
|
||||||
set -e
|
set -e
|
||||||
kubectl apply -f deploy/kubernetes/ --validate=true
|
kubectl apply -f deploy/kubernetes/ --validate=true
|
||||||
|
|
@ -119,6 +93,8 @@ spec:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue