Skip to content

Commit

Permalink
build: adding env vars to connect to Kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabNeu committed Nov 18, 2023
1 parent a2e2d26 commit 103cec9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ ConfigMap data
app_db: {{ .app_db }}
app_dbport: {{ .app_dbport | quote }}
app_dbschema: {{ .app_dbschema }}
k8s_group: {{ .k8s_group }}
k8s_api_version: {{ .k8s_api_version }}
k8s_cr_kind: {{ .k8s_cr_kind }}
k8s_cr_kind_plural: {{ .k8s_cr_kind_plural }}
k8s_namespace: {{ .k8s_namespace }}
k8s_broker_0: {{ .k8s_broker_0 }}
k8s_broker_1: {{ .k8s_broker_1 }}
k8s_broker_2: {{ .k8s_broker_2 }}
k8s_client_id: {{ .k8s_client_id }}
k8s_docker_config_json: {{ .k8s_docker_config_json }}
k8s_topic: {{ .k8s_topic }}

{{- end }}
{{- end }}

Expand Down
55 changes: 55 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,61 @@ spec:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: app_dbschema
- name: K8S_GROUP
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_group
- name: K8S_API_VERSION
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_api_version
- name: K8S_CR_KIND
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_cr_kind
- name: K8S_CR_KIND_PLURAL
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_cr_kind_plural
- name: K8S_NAMESPACE
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_namespace
- name: K8S_BROKER_0
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_broker_0
- name: K8S_BROKER_1
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_broker_1
- name: K8S_BROKER_2
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_broker_2
- name: K8S_CLIENT_ID
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_client_id
- name: K8S_DOCKER_CONFIG_JSON
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_docker_config_json
- name: K8S_TOPIC
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-configmap
key: k8s_topic
initContainers:
- name: db-migration
image: {{ .Values.image.initContainerImg }}
Expand Down
11 changes: 11 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ config:
app_db: app
app_dbport: "5432"
app_dbschema: app
k8s_group: webappcron.csye7125-fall2023-group05.cloud
k8s_api_version: v1
k8s_cr_kind: Cron
k8s_cr_kind_plural: crons
k8s_namespace: default
k8s_broker_0: infra-helm-release-kafka-broker-0.infra-helm-release-kafka-broker-headless.webapp.svc.cluster.local:9094
k8s_broker_1: infra-helm-release-kafka-broker-1.infra-helm-release-kafka-broker-headless.webapp.svc.cluster.local:9094
k8s_broker_2: infra-helm-release-kafka-broker-2.infra-helm-release-kafka-broker-headless.webapp.svc.cluster.local:9094
k8s_client_id: webapp
k8s_docker_config_json: ewogICJhdXRocyI6IHsKICAgICJxdWF5LmlvIjogewogICAgICAiYXV0aCI6ICJjSGR1WTI5eWNDdHliMkp2WTI5d09qaE1URTQyVWs5RFdsSlNUa2xTUWtGTU0weElSVms1UWpORFRVS
k8s_topic: healthcheck

secret:
type: Opaque
Expand Down

0 comments on commit 103cec9

Please sign in to comment.