From 81db7ff00d7be90aa14dd08619cf9ef67706e0d8 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sun, 24 Jun 2018 21:05:48 +1000 Subject: [PATCH] Add patch for certificate --- .gitlab-ci.yml | 2 ++ k8s/deployment_template.jsonnet | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8b10705..07874862 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,7 @@ build_review_deployment: paths: - k8s/deployment.json - k8s/ingress-patch.json + - k8s/certificate-patch.json build_2019_dev_image: image: docker:git @@ -94,6 +95,7 @@ k8s-2019_dev_review-deploy: - kubectl config use-context cluster - kubectl --token "${GL_KUBE_TOKEN}" apply -f k8s/deployment.json - kubectl --token "${GL_KUBE_TOKEN}" describe ingress | grep "${CI_COMMIT_REF_SLUG}" || kubectl --token "${GL_KUBE_TOKEN}" patch ingress symposion-app-ingress -p "$(cat k8s/ingress-patch.json)" --type json + - kubectl --token "${GL_KUBE_TOKEN}" describe certificate | grep "${CI_COMMIT_REF_SLUG}" || kubectl --token "${GL_KUBE_TOKEN}" patch certificate dev-lca2019-org -p "$(cat k8s/certificate-patch.json)" --type json only: - /^dev\/.*$/ environment: diff --git a/k8s/deployment_template.jsonnet b/k8s/deployment_template.jsonnet index dd5b55f8..bd2c7548 100644 --- a/k8s/deployment_template.jsonnet +++ b/k8s/deployment_template.jsonnet @@ -160,4 +160,22 @@ function (slug) { "value": domain } ], + "certificate-patch.json": [ + { + "op": "add", + "path": "/spec/acme/config/-", + "value": { + "domains": [ domain ], + "http01": { + "ingress": "", + "ingressClass": "nginx" + } + } + }, + { + "op": "add", + "path": "/spec/dnsNames/-", + "value": domain + } + ] }