Adjust Kubernetes manifests for deploying API service (#8281)

This PR adjusts our Kubernetes manifests for deploying the new API
service.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Marshall Bowers 2024-02-23 12:14:40 -05:00 committed by GitHub
parent f19ab464c7
commit 522176d414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 8 deletions

View file

@ -120,6 +120,12 @@ jobs:
export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header) export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
export ZED_IMAGE_ID="registry.digitalocean.com/zed/collab:${GITHUB_SHA}" export ZED_IMAGE_ID="registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
export ZED_SERVICE_NAME=collab
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f - envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status deployment/collab --watch kubectl -n "$ZED_KUBE_NAMESPACE" rollout status deployment/$ZED_SERVICE_NAME --watch
echo "deployed collab.template.yml to ${ZED_KUBE_NAMESPACE}" echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
export ZED_SERVICE_NAME=api
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status deployment/$ZED_SERVICE_NAME --watch
echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"

View file

@ -9,7 +9,7 @@ kind: Service
apiVersion: v1 apiVersion: v1
metadata: metadata:
namespace: ${ZED_KUBE_NAMESPACE} namespace: ${ZED_KUBE_NAMESPACE}
name: collab name: ${ZED_SERVICE_NAME}
annotations: annotations:
service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443" service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
service.beta.kubernetes.io/do-loadbalancer-certificate-id: ${ZED_DO_CERTIFICATE_ID} service.beta.kubernetes.io/do-loadbalancer-certificate-id: ${ZED_DO_CERTIFICATE_ID}
@ -17,7 +17,7 @@ metadata:
spec: spec:
type: LoadBalancer type: LoadBalancer
selector: selector:
app: collab app: ${ZED_SERVICE_NAME}
ports: ports:
- name: web - name: web
protocol: TCP protocol: TCP
@ -29,17 +29,17 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
namespace: ${ZED_KUBE_NAMESPACE} namespace: ${ZED_KUBE_NAMESPACE}
name: collab name: ${ZED_SERVICE_NAME}
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: collab app: ${ZED_SERVICE_NAME}
template: template:
metadata: metadata:
labels: labels:
app: collab app: ${ZED_SERVICE_NAME}
annotations: annotations:
ad.datadoghq.com/collab.check_names: | ad.datadoghq.com/collab.check_names: |
["openmetrics"] ["openmetrics"]
@ -55,7 +55,7 @@ spec:
] ]
spec: spec:
containers: containers:
- name: collab - name: ${ZED_SERVICE_NAME}
image: "${ZED_IMAGE_ID}" image: "${ZED_IMAGE_ID}"
args: args:
- serve - serve
@ -130,6 +130,26 @@ spec:
secretKeyRef: secretKeyRef:
name: blob-store name: blob-store
key: bucket key: bucket
- name: CLICKHOUSE_URL
valueFrom:
secretKeyRef:
name: clickhouse
key: url
- name: CLICKHOUSE_USER
valueFrom:
secretKeyRef:
name: clickhouse
key: user
- name: CLICKHOUSE_PASSWORD
valueFrom:
secretKeyRef:
name: clickhouse
key: password
- name: CLICKHOUSE_DATABASE
valueFrom:
secretKeyRef:
name: clickhouse
key: database
- name: INVITE_LINK_PREFIX - name: INVITE_LINK_PREFIX
value: ${INVITE_LINK_PREFIX} value: ${INVITE_LINK_PREFIX}
- name: RUST_BACKTRACE - name: RUST_BACKTRACE