|
@@ -133,7 +133,7 @@ def generateCanaryService(Map kvs, String version, String template="service.yaml
|
|
|
return outputFile
|
|
return outputFile
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-def applyDeployment(Object K3S, String deployment="deployment.yaml") {
|
|
|
|
|
|
|
+def applyDeployment(Object K3S, String deployment="deployment.yaml", String defaultNS='default') {
|
|
|
|
|
|
|
|
if (!fileExists(deployment)) {
|
|
if (!fileExists(deployment)) {
|
|
|
println "ignore, file ${deployment} not exists"
|
|
println "ignore, file ${deployment} not exists"
|
|
@@ -141,10 +141,10 @@ def applyDeployment(Object K3S, String deployment="deployment.yaml") {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
println "applying k8s deployment file: ${deployment} ..."
|
|
println "applying k8s deployment file: ${deployment} ..."
|
|
|
- sh "/k3s/kubectl --kubeconfig ${env.WORKSPACE}/${K3S.kubeconfig} apply -f ${deployment}"
|
|
|
|
|
|
|
+ sh "/k3s/kubectl --kubeconfig ${env.WORKSPACE}/${K3S.kubeconfig} apply -f ${deployment} -n ${defaultNS}"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-def applyService(K3S, String service="service.yaml") {
|
|
|
|
|
|
|
+def applyService(K3S, String service="service.yaml", String defaultNS='default') {
|
|
|
|
|
|
|
|
if (!fileExists(service)) {
|
|
if (!fileExists(service)) {
|
|
|
println "ignore, file ${service} not exists"
|
|
println "ignore, file ${service} not exists"
|
|
@@ -152,7 +152,7 @@ def applyService(K3S, String service="service.yaml") {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
println "applying k8s deployment file: ${service} ..."
|
|
println "applying k8s deployment file: ${service} ..."
|
|
|
- sh "/k3s/kubectl --kubeconfig ${env.WORKSPACE}/${K3S.kubeconfig} apply -f ${service}"
|
|
|
|
|
|
|
+ sh "/k3s/kubectl --kubeconfig ${env.WORKSPACE}/${K3S.kubeconfig} apply -f ${service} -n ${defaultNS}"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-return this
|
|
|
|
|
|
|
+return this
|