Changeset - 81db7ff00d7b
[Not reviewed]
0 2 0
James Polley - 6 years ago 2018-06-24 11:12:37
jp@jamezpolley.com
Add patch for certificate
2 files changed with 20 insertions and 0 deletions:
0 comments (0 inline, 0 general)
.gitlab-ci.yml
Show inline comments
...
 
@@ -46,12 +46,13 @@ build_review_deployment:
 
  script:
 
    - docker run -v "${PWD}"/k8s:/src sparkprime/jsonnet /src/deployment_template.jsonnet --tla-str slug="${CI_COMMIT_REF_SLUG}" -m /src
 
  artifacts:
 
    paths:
 
    - k8s/deployment.json
 
    - k8s/ingress-patch.json
 
    - k8s/certificate-patch.json
 

	
 
build_2019_dev_image:
 
  image: docker:git
 
  stage: build
 
  services:
 
  - docker:dind
...
 
@@ -91,12 +92,13 @@ k8s-2019_dev_review-deploy:
 
  - echo "${CA_CERT}" > cert.crt
 
  - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
  - kubectl config set-context cluster --cluster=cluster --namespace=rego-review --user=rego-dev/gitlab-sa
 
  - 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:
 
    name: 2019/dev/${CI_COMMIT_REF_SLUG}
 
    url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
 
    on_stop: k8s-2019_dev_review-stop-deploy
k8s/deployment_template.jsonnet
Show inline comments
...
 
@@ -157,7 +157,25 @@ function (slug) {
 
      {
 
        "op": "add",
 
        "path": "/spec/tls/0/hosts/-",
 
        "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
 
      }
 
  ]
 
}
0 comments (0 inline, 0 general)