Skip to content

Commit

Permalink
Make ingress certificate and couch node selector optional (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nydr authored Apr 18, 2024
1 parent 5a514b1 commit e85d95a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/cht-chart-4x/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.2
version: 0.2.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 6 additions & 0 deletions charts/cht-chart-4x/templates/couchdb-n-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ spec:
operator: {{ $root.Values.toleration.operator }}
value: {{ $root.Values.toleration.value | quote }}
effect: {{ $root.Values.toleration.effect }}
{{- with index $root.Values.nodes (printf "node-%d" $nodeNumber) }}
{{- if . }}
nodeSelector:
kubernetes.io/hostname: {{ . }}
{{- end }}
{{- end }}
containers:
- name: cht-couchdb-{{ $nodeNumber }}
image: {{ $root.Values.upstream_servers.docker_registry }}/cht-couchdb:{{ $root.Values.cht_image_tag }}
Expand Down
9 changes: 4 additions & 5 deletions charts/cht-chart-4x/templates/couchdb-single-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ spec:
cht.service: couchdb
spec:
tolerations:
- key: {{ .Values.toleration.key }}
operator: {{ .Values.toleration.operator }}
value: {{ .Values.toleration.value | quote }}
effect: {{ .Values.toleration.effect }}
# Check if .Values.nodes.single_node_deploy has a value
- key: {{ .Values.toleration.key }}
operator: {{ .Values.toleration.operator }}
value: {{ .Values.toleration.value | quote }}
effect: {{ .Values.toleration.effect }}
{{- if hasKey .Values "nodes" }}
{{- if hasKey .Values.nodes "single_node_deploy" }}
nodeSelector:
Expand Down
2 changes: 2 additions & 0 deletions charts/cht-chart-4x/templates/eks-api-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ metadata:
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
{{- if and (hasKey .Values.ingress.annotations "certificate") .Values.ingress.annotations.certificate }}
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.annotations.certificate }}
{{- end }}
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
spec:
ingressClassName: alb
Expand Down
8 changes: 4 additions & 4 deletions charts/cht-chart-4x/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ingress:
annotations:
groupname: "dev-cht-alb"
tags: "Environment=dev,Team=QA"
certificate: "arn:aws:iam::<account-id>:server-certificate/2023-wildcard-dev-medicmobile-org-chain"
certificate: "arn:aws:iam::<account-id>:server-certificate/2024-wildcard-dev-medicmobile-org-chain"
# Ensure the host is not already taken. Valid characters for a subdomain are:
# a-z, 0-9, and - (but not as first or last character).
host: "<subdomain>.dev.medicmobile.org"
Expand All @@ -45,9 +45,9 @@ certificate_key_file_path: "/path/to/certificate.key" # Only required if cert_so
nodes:
# If using clustered couchdb, add the nodes here: node-1: name-of-first-node, node-2: name-of-second-node, etc.
# Add equal number of nodes as specified in clusteredCouch.noOfCouchDBNodes
node-1: "gamma-cht-couchdb-1" # This is the name of the first node where couchdb will be deployed
node-2: "gamma-cht-couchdb-2" # This is the name of the second node where couchdb will be deployed
node-3: "gamma-cht-couchdb-3" # This is the name of the third node where couchdb will be deployed
node-1: "" # This is the name of the first node where couchdb will be deployed
node-2: "" # This is the name of the second node where couchdb will be deployed
node-3: "" # This is the name of the third node where couchdb will be deployed
# For single couchdb node, use the following:
# Leave it commented out if you don't know what it means.
# Leave it commented out if you want to let kubernetes deploy this on any available node. (Recommended)
Expand Down

0 comments on commit e85d95a

Please sign in to comment.