From c1ee10dbe73d800cc134cd26fb2c5d32666bb3e2 Mon Sep 17 00:00:00 2001 From: jrmartin Date: Wed, 13 Mar 2024 07:31:36 -0700 Subject: [PATCH] #SDSV-24 Update codefresh deployment --- deploy/k8s/codefresh.yaml | 12 ++++-------- deploy/k8s/ingress.yaml | 40 ++++++++++++++++++++++++++++++++++++++ deploy/k8s/sds_viewer.yaml | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 8 deletions(-) create mode 100755 deploy/k8s/ingress.yaml create mode 100755 deploy/k8s/sds_viewer.yaml diff --git a/deploy/k8s/codefresh.yaml b/deploy/k8s/codefresh.yaml index af79cb3..15c9a10 100644 --- a/deploy/k8s/codefresh.yaml +++ b/deploy/k8s/codefresh.yaml @@ -23,16 +23,12 @@ steps: deploy: stage: "deploy" title: "Deploying SDS Viewer" - image: codefresh/kubectl + image: codefresh/cf-deploy-kubernetes + tag: latest working_directory: ./sds-viewer/deploy/k8s commands: - - export CLUSTER_NAME="${{CLUSTER_NAME}}" - - export NAMESPACE="${{NAMESPACE}}" - - export CF_BUILD_ID="${{CF_BUILD_ID}}" - - export REGISTRY="${{REGISTRY}}/" - - export DOMAIN="${{DOMAIN}}" - - chmod +x ./deploy.sh - - ./deploy.sh + - /cf-deploy-kubernetes cde-mapper.yaml + - /cf-deploy-kubernetes ingress.yaml environment: - KUBECONTEXT=${{CLUSTER_NAME}} - KUBERNETES_NAMESPACE=${{NAMESPACE}} \ No newline at end of file diff --git a/deploy/k8s/ingress.yaml b/deploy/k8s/ingress.yaml new file mode 100755 index 0000000..b72f8cf --- /dev/null +++ b/deploy/k8s/ingress.yaml @@ -0,0 +1,40 @@ +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: 'letsencrypt-sds-viewer' +spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + email: filippo@metacell.us + privateKeySecretRef: + name: letsencrypt-sds-viewer + solvers: + - http01: + ingress: + class: nginx +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/issuer: letsencrypt-sds-viewer + kubernetes.io/ingress.class: nginx + kubernetes.io/tls-acme: 'true' + nginx.ingress.kubernetes.io/proxy-body-size: 512m + name: sds-viewer-nginx-ingress +spec: + rules: + - host: "{{DOMAIN}}" + http: + paths: + - backend: + service: + name: sds-viewer + port: + number: 80 + path: / + pathType: ImplementationSpecific + tls: + - hosts: + - "{{DOMAIN}}" + secretName: sds-viewer-tls diff --git a/deploy/k8s/sds_viewer.yaml b/deploy/k8s/sds_viewer.yaml new file mode 100755 index 0000000..3f0a039 --- /dev/null +++ b/deploy/k8s/sds_viewer.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sds-viewer +spec: + selector: + matchLabels: + app: sds-viewer + replicas: 1 + template: + metadata: + labels: + app: sds-viewer + spec: + containers: + - name: sds-viewer + image: "{{REGISTRY}}sds-viewer:{{CF_BUILD_ID}}" + imagePullPolicy: "IfNotPresent" + ports: + - containerPort: 80 + resources: + limits: + cpu: 1500m + memory: 768Mi + requests: + cpu: 500m + memory: 768Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: sds-viewer +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 80 + selector: + app: sds-viewer