From 2adb0f844301f7d7fd282a88f2d867723cac0087 Mon Sep 17 00:00:00 2001 From: Charles Coleman Date: Wed, 3 Jul 2024 09:14:05 -0400 Subject: [PATCH] Add cosmos to kube (#411) --- .../services/cosmos/cosmos-deployment.yaml | 49 +++++++++++++++++++ .../base/services/cosmos/cosmos-service.yaml | 22 +++++++++ .../base/services/cosmos/kustomization.yaml | 7 +++ .../hmi/server/hmi-server-deployment.yaml | 4 +- .../overlays/prod/base/kustomization.yaml | 4 ++ .../services/cosmos/cosmos-deployment.yaml | 8 +++ .../ingress/private-web-ingress.yaml | 12 +++++ .../overlays/askem-dev/kustomization.yaml | 6 +++ .../services/cosmos/cosmos-service.yaml | 7 +++ .../askem-production/kustomization.yaml | 5 ++ .../ingress/private-web-ingress.yaml | 19 +++++++ .../overlays/askem-staging/kustomization.yaml | 6 +++ .../services/cosmos/cosmos-service.yaml | 7 +++ 13 files changed, 155 insertions(+), 1 deletion(-) create mode 100755 kubernetes/base/services/cosmos/cosmos-deployment.yaml create mode 100755 kubernetes/base/services/cosmos/cosmos-service.yaml create mode 100644 kubernetes/base/services/cosmos/kustomization.yaml create mode 100644 kubernetes/overlays/prod/base/services/cosmos/cosmos-deployment.yaml create mode 100644 kubernetes/overlays/prod/overlays/askem-dev/services/cosmos/cosmos-service.yaml create mode 100755 kubernetes/overlays/prod/overlays/askem-staging/services/cosmos/cosmos-service.yaml diff --git a/kubernetes/base/services/cosmos/cosmos-deployment.yaml b/kubernetes/base/services/cosmos/cosmos-deployment.yaml new file mode 100755 index 00000000..abff2619 --- /dev/null +++ b/kubernetes/base/services/cosmos/cosmos-deployment.yaml @@ -0,0 +1,49 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cosmos + labels: + software.uncharted.terarium/name: cosmos + software.uncharted.terarium/component: cosmos + software.uncharted.terarium/service: cosmos + software.uncharted.terarium/part-of: services +spec: + replicas: 1 + selector: + matchLabels: + software.uncharted.terarium/name: cosmos + strategy: + type: Recreate + template: + metadata: + labels: + software.uncharted.terarium/name: cosmos + spec: + containers: + - name: cosmos + image: cosmos-image + imagePullPolicy: Always + ports: + - containerPort: 8089 + readinessProbe: + httpGet: + path: / + port: 8089 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + livenessProbe: + httpGet: + path: / + port: 8089 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + resources: {} + imagePullSecrets: + - name: ghcr-cred + restartPolicy: Always +status: {} diff --git a/kubernetes/base/services/cosmos/cosmos-service.yaml b/kubernetes/base/services/cosmos/cosmos-service.yaml new file mode 100755 index 00000000..8667ecf5 --- /dev/null +++ b/kubernetes/base/services/cosmos/cosmos-service.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: cosmos + labels: + software.uncharted.terarium/name: cosmos + software.uncharted.terarium/component: cosmos + software.uncharted.terarium/service: cosmos + software.uncharted.terarium/part-of: services + annotations: + alb.ingress.kubernetes.io/healthcheck-path: '/ping' +spec: + ports: + - name: 4048-tcp + port: 4048 + protocol: TCP + targetPort: 8089 + selector: + software.uncharted.terarium/name: cosmos +status: + loadBalancer: {} diff --git a/kubernetes/base/services/cosmos/kustomization.yaml b/kubernetes/base/services/cosmos/kustomization.yaml new file mode 100644 index 00000000..47a05c4b --- /dev/null +++ b/kubernetes/base/services/cosmos/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: terarium +resources: + - cosmos-deployment.yaml + - cosmos-service.yaml diff --git a/kubernetes/overlays/prod/base/hmi/server/hmi-server-deployment.yaml b/kubernetes/overlays/prod/base/hmi/server/hmi-server-deployment.yaml index daec8fd8..e547d3e3 100755 --- a/kubernetes/overlays/prod/base/hmi/server/hmi-server-deployment.yaml +++ b/kubernetes/overlays/prod/base/hmi/server/hmi-server-deployment.yaml @@ -20,7 +20,9 @@ spec: - name: CIEMSS-SERVICE_URL value: 'http://pyciemss-api:3040' - name: CLIMATE-DATA-SERVICE_URL - value: 'http://climate-data:8000' + value: "http://climate-data:8000" + - name: COSMOS-SERVICE_URL + value: "http://cosmos:4048" - name: GOOGLE-ANALYTICS-ID valueFrom: secretKeyRef: diff --git a/kubernetes/overlays/prod/base/kustomization.yaml b/kubernetes/overlays/prod/base/kustomization.yaml index a8008b34..56f7a90e 100644 --- a/kubernetes/overlays/prod/base/kustomization.yaml +++ b/kubernetes/overlays/prod/base/kustomization.yaml @@ -7,6 +7,7 @@ resources: - ../../../base/hmi/documentation - ../../../base/hmi/server - ../../../base/services/climate-data + - ../../../base/services/cosmos - ../../../base/services/beaker - ../../../base/services/data-service - ../../../base/services/gollm-taskrunner @@ -27,6 +28,9 @@ patches: - path: hmi/server/hmi-server-service.yaml - path: hmi/server/spicedb-deployment.yaml - path: hmi/server/spicedb-service.yaml + - path: keycloak/keycloak-deployment.yaml + - path: keycloak/keycloak-service.yaml + - path: services/cosmos/cosmos-deployment.yaml - path: services/beaker/beaker-deployment.yaml - path: services/data-service/data-service-graphdb-deployment.yaml - path: services/climate-data/climate-data-deployment.yaml diff --git a/kubernetes/overlays/prod/base/services/cosmos/cosmos-deployment.yaml b/kubernetes/overlays/prod/base/services/cosmos/cosmos-deployment.yaml new file mode 100644 index 00000000..df6c342c --- /dev/null +++ b/kubernetes/overlays/prod/base/services/cosmos/cosmos-deployment.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cosmos +spec: + strategy: + type: RollingUpdate diff --git a/kubernetes/overlays/prod/overlays/askem-dev/ingress/private-web-ingress.yaml b/kubernetes/overlays/prod/overlays/askem-dev/ingress/private-web-ingress.yaml index bc9540ef..cf553f1e 100644 --- a/kubernetes/overlays/prod/overlays/askem-dev/ingress/private-web-ingress.yaml +++ b/kubernetes/overlays/prod/overlays/askem-dev/ingress/private-web-ingress.yaml @@ -155,11 +155,23 @@ spec: port: number: 8000 + - host: 'cosmos.dev.terarium.ai' + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: cosmos + port: + number: 4048 + tls: - hosts: - 'app.dev.terarium.ai' - 'beaker.dev.terarium.ai' - 'climate-data.dev.terarium.ai' + - 'cosmos.dev.terarium.ai' - 'documentation.dev.terarium.ai' - 'funman.dev.terarium.ai' - 'graphdb.dev.terarium.ai' diff --git a/kubernetes/overlays/prod/overlays/askem-dev/kustomization.yaml b/kubernetes/overlays/prod/overlays/askem-dev/kustomization.yaml index 936fdea8..1d8f3013 100644 --- a/kubernetes/overlays/prod/overlays/askem-dev/kustomization.yaml +++ b/kubernetes/overlays/prod/overlays/askem-dev/kustomization.yaml @@ -31,6 +31,7 @@ patches: - path: services/climate-data/climate-data-deployment.yaml - path: services/climate-data/climate-data-service.yaml - path: services/climate-data/climate-data-worker-deployment.yaml + - path: services/cosmos/cosmos-service.yaml - path: services/data-service/data-service-graphdb-service.yaml - path: services/mit/mit-tr-service.yaml - path: services/pyciemss-service/pyciemss-api-deployment.yaml @@ -129,6 +130,11 @@ images: newName: ghcr.io/darpa-askem/mira-taskrunner newTag: 'latest' + # cosmos (xdd) + - name: cosmos-image + newName: ghcr.io/darpa-askem/cosmos-service + newTag: 'cpu-2024_04_19' + # funman taskrunner - name: funman-taskrunner-image newName: ghcr.io/darpa-askem/funman-taskrunner diff --git a/kubernetes/overlays/prod/overlays/askem-dev/services/cosmos/cosmos-service.yaml b/kubernetes/overlays/prod/overlays/askem-dev/services/cosmos/cosmos-service.yaml new file mode 100644 index 00000000..fa490436 --- /dev/null +++ b/kubernetes/overlays/prod/overlays/askem-dev/services/cosmos/cosmos-service.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: cosmos +spec: + type: ClusterIP diff --git a/kubernetes/overlays/prod/overlays/askem-production/kustomization.yaml b/kubernetes/overlays/prod/overlays/askem-production/kustomization.yaml index d4a8329c..5bc4c965 100644 --- a/kubernetes/overlays/prod/overlays/askem-production/kustomization.yaml +++ b/kubernetes/overlays/prod/overlays/askem-production/kustomization.yaml @@ -128,6 +128,11 @@ images: newName: ghcr.io/darpa-askem/mira-taskrunner newTag: '2.14.1' + # cosmos (xdd) + - name: cosmos-image + newName: ghcr.io/darpa-askem/cosmos-service + newTag: 'cpu-2024_04_19' + # funman taskrunner - name: funman-taskrunner-image newName: ghcr.io/darpa-askem/funman-taskrunner diff --git a/kubernetes/overlays/prod/overlays/askem-staging/ingress/private-web-ingress.yaml b/kubernetes/overlays/prod/overlays/askem-staging/ingress/private-web-ingress.yaml index 0d2d0276..dd44c2f1 100644 --- a/kubernetes/overlays/prod/overlays/askem-staging/ingress/private-web-ingress.yaml +++ b/kubernetes/overlays/prod/overlays/askem-staging/ingress/private-web-ingress.yaml @@ -210,10 +210,29 @@ spec: port: number: 3050 + - host: 'cosmos.staging.terarium.ai' + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: ssl-redirect + port: + name: use-annotation + - path: / + pathType: Prefix + backend: + service: + name: cosmos + port: + number: 4048 + tls: - hosts: - 'beaker.staging.terarium.ai' - 'climate-data.staging.terarium.ai' + - 'cosmos.staging.terarium.ai' - 'funman.staging.terarium.ai' - 'graphdb.staging.terarium.ai' - 'mit-proxy.staging.terarium.ai' diff --git a/kubernetes/overlays/prod/overlays/askem-staging/kustomization.yaml b/kubernetes/overlays/prod/overlays/askem-staging/kustomization.yaml index da9ceab8..2c70ee35 100644 --- a/kubernetes/overlays/prod/overlays/askem-staging/kustomization.yaml +++ b/kubernetes/overlays/prod/overlays/askem-staging/kustomization.yaml @@ -29,6 +29,7 @@ patches: - path: services/climate-data/climate-data-deployment.yaml - path: services/climate-data/climate-data-service.yaml - path: services/climate-data/climate-data-worker-deployment.yaml + - path: services/cosmos/cosmos-service.yaml - path: services/data-service/data-service-graphdb-service.yaml - path: services/gollm-taskrunner/gollm-taskrunner-deployment.yaml - path: services/mit/mit-tr-service.yaml @@ -114,6 +115,11 @@ images: newName: ghcr.io/darpa-askem/mira-taskrunner newTag: 'latest' + # cosmos (xdd) + - name: cosmos-image + newName: ghcr.io/darpa-askem/cosmos-service + newTag: 'cpu-2024_04_19' + # funman taskrunner - name: funman-taskrunner-image newName: ghcr.io/darpa-askem/funman-taskrunner diff --git a/kubernetes/overlays/prod/overlays/askem-staging/services/cosmos/cosmos-service.yaml b/kubernetes/overlays/prod/overlays/askem-staging/services/cosmos/cosmos-service.yaml new file mode 100755 index 00000000..f35aa2bd --- /dev/null +++ b/kubernetes/overlays/prod/overlays/askem-staging/services/cosmos/cosmos-service.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: cosmos +spec: + type: NodePort