-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helm chart for cht sync #90
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e9c077c
add helm chart
witash abe9981
fix typos
witash ed79362
add volumeClaim and remove serviceName
witash 7c3c398
changing postgres service to load balancer for access
witash 6e432da
Merge branch 'main' into helm
witash 07063c4
add redis and redis-worker
witash a44b933
fix sonar issues and resource limits
witash bb43d08
fix defaults and allow configurable limts
witash 3118482
tag images with branch and allow use in templates
witash 34ff7c8
initialize table in dbt container
witash c1bf1ff
remove external load balancer
witash 328375a
remove defaults in values template
witash 9b24f2a
Merge branch 'main' into helm
witash afdca7b
change redis port
witash b86a1ad
remove newline from env var
witash 35462d4
Merge branch 'main' into helm
witash 0e23dce
Merge branch 'main' into helm
witash 6fbb592
remove old templates and add couch2pg
witash 5e4f34f
multiple instances for couch2pg
witash 4325b6a
Merge branch 'main' into helm
witash cd03d4b
allow user,dbs,port, and secure to vary
witash 458e9c9
adding multi instance example
witash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: cht_sync | ||
description: A Helm chart for Kubernetes | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
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.1.0 | ||
|
||
# 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 | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{{- $couchdbs := .Values.couchdbs -}} | ||
{{- range $index, $service := $couchdbs }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cht-sync-couch2pg--{{ $service.host | replace "." "-" }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cht-sync | ||
template: | ||
metadata: | ||
labels: | ||
app: cht-sync | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: couch2pg | ||
image: medicmobile/cht-sync-couch2pg:{{ $.Values.image_tag | default "latest" }} | ||
resources: | ||
limits: | ||
cpu: {{ ($.Values.couch2pg).cpu_limit | default "500m" }} | ||
memory: {{ ($.Values.couch2pg).memory_limit | default "1Gi" }} | ||
env: | ||
- name: POSTGRES_HOST | ||
value: {{ $.Values.postgres.host | default "postgres" }} | ||
- name: POSTGRES_USER | ||
value: {{ $.Values.postgres.user }} | ||
- name: POSTGRES_PORT | ||
value: {{ $.Values.postgres.port | default "5432" | quote }} | ||
- name: POSTGRES_PASSWORD | ||
value: {{ $.Values.postgres.password }} | ||
- name: POSTGRES_DB | ||
value: {{ $.Values.postgres.db }} | ||
- name: POSTGRES_TABLE | ||
value: {{ $.Values.postgres.table }} | ||
- name: POSTGRES_SCHEMA | ||
value: {{ $.Values.postgres.schema }} | ||
- name: COUCHDB_USER | ||
value: {{ $service.user | default $.Values.couchdb.user }} | ||
- name: COUCHDB_PASSWORD | ||
value: {{ $service.password }} | ||
- name: COUCHDB_HOST | ||
value: {{ $service.host }} | ||
- name: COUCHDB_DBS | ||
value: {{ $service.dbs | default $.Values.couchdb.dbs }} | ||
- name: COUCHDB_PORT | ||
value: {{ ($service.port | default $.Values.couchdb.port) | quote }} | ||
- name: COUCHDB_SECURE | ||
value: {{ ($service.secure | default $.Values.couchdb.secure) | quote }} | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cht-sync-dbt | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cht-sync | ||
template: | ||
metadata: | ||
labels: | ||
app: cht-sync | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: dbt | ||
Check warning Code scanning / SonarCloud CPU limits should be enforced Medium
Specify a CPU limit for this container. See more on SonarCloud
Check warning Code scanning / SonarCloud Memory limits should be enforced Medium
Specify a memory limit for this container. See more on SonarCloud
|
||
image: medicmobile/dataemon:{{ .Values.image_tag | default "latest" }} | ||
resources: | ||
limits: | ||
cpu: {{ (.Values.dbt).cpu_limit | default "500m" }} | ||
memory: {{ (.Values.dbt).memory_limit | default "1Gi" }} | ||
env: | ||
- name: POSTGRES_HOST | ||
value: {{ .Values.postgres.host | default "postgres" }} | ||
- name: POSTGRES_USER | ||
value: {{ .Values.postgres.user }} | ||
- name: POSTGRES_PORT | ||
value: {{ .Values.postgres.port | default "5432" | quote }} | ||
- name: POSTGRES_PASSWORD | ||
value: {{ .Values.postgres.password }} | ||
- name: POSTGRES_DB | ||
value: {{ .Values.postgres.db }} | ||
- name: POSTGRES_TABLE | ||
value: {{ .Values.postgres.table }} | ||
- name: POSTGRES_SCHEMA | ||
value: {{ .Values.postgres.schema }} | ||
- name: ROOT_POSTGRES_SCHEMA | ||
value: {{ .Values.postgres.schema }} | ||
- name: CHT_PIPELINE_BRANCH_URL | ||
value: {{ .Values.cht_pipeline_branch_url }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.postgres.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres | ||
spec: | ||
selector: | ||
inner.service: postgres | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.postgres.port | default "5432" }} | ||
targetPort: 5432 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# templates/postgres.yaml | ||
|
||
{{- if .Values.postgres.enabled }} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: cht-sync-postgres | ||
spec: | ||
serviceName: postgres | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cht-sync | ||
inner.service: postgres | ||
template: | ||
metadata: | ||
labels: | ||
app: cht-sync | ||
inner.service: postgres | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: postgres-c | ||
image: postgres:13 | ||
resources: | ||
limits: | ||
cpu: {{ (.Values.postgres).cpu_limit | default "1000m" }} | ||
memory: {{ (.Values.postgres).memory_limit | default "2Gi" }} | ||
env: | ||
- name: POSTGRES_USER | ||
value: {{ .Values.postgres.user }} | ||
- name: POSTGRES_PASSWORD | ||
value: {{ .Values.postgres.password }} | ||
- name: POSTGRES_DB | ||
value: {{ .Values.postgres.db }} | ||
ports: | ||
- containerPort: {{ .Values.postgres.port | default "5432" }} | ||
|
||
volumeClaimTemplates: | ||
- metadata: | ||
name: postgres-data | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
resources: | ||
requests: | ||
storage: {{ .Values.postgres.storageSize | default "1Gi" }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgrest | ||
spec: | ||
selector: | ||
inner.service: postgrest | ||
ports: | ||
- protocol: TCP | ||
port: 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
postgres: | ||
enabled: true # if true a postgres service will not be created in this cluster | ||
user: "" | ||
password: "" | ||
db: "" | ||
schema: "v1" | ||
table: "medic" | ||
host: "postgres" # if postgres is outside the cluster | ||
port: 5432 # if postgres is outside the cluster | ||
|
||
cht_pipeline_branch_url: "https://github.com/medic/cht-pipeline.git#main" | ||
|
||
# values shared by all couchdb instances | ||
# can be omitted if couchdb instances do not share any values | ||
couchdb: | ||
user: "" | ||
dbs: "medic" # space separated list of databases you want to sync e.g "medic medic-sentinel" | ||
port: "5984" | ||
witash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
secure: "true" # "true" if SSL is required | ||
|
||
# values for each couchdb instance | ||
# host and password are required | ||
# other values can be omitted if they are common to all couchdb instances and specified above | ||
couchdbs: | ||
- host: "host1" # required for all couchdb instances | ||
password: "" # required for all couchdb instances | ||
- host: "host2" | ||
password: "" | ||
- host: "host3" | ||
password: "" | ||
user: "user2" # required if different than above | ||
dbs: "medic medic_sentinel" # required if different than above | ||
port: "5984" # required if different than above | ||
secure: "true" # required if different than above |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / SonarCloud
Service account tokens should not be mounted in pods Medium