Skip to content

Commit

Permalink
updating audit service to enable use of slim image conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
EliseCastle23 committed Jul 10, 2024
1 parent d5b4329 commit a763e7d
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-07-02T16:36:02Z",
"generated_at": "2024-07-10T17:29:48Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -426,7 +426,7 @@
"hashed_secret": "44cb746036385723dde2ac36e53da8932a69bfe2",
"is_secret": false,
"is_verified": false,
"line_number": 108,
"line_number": 112,
"type": "Secret Keyword"
}
],
Expand Down Expand Up @@ -506,7 +506,7 @@
"hashed_secret": "489e396b7c68f95c6018f7b98ef7b1b94587ef29",
"is_secret": false,
"is_verified": false,
"line_number": 103,
"line_number": 107,
"type": "Secret Keyword"
}
],
Expand Down
4 changes: 2 additions & 2 deletions helm/audit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.1.12
version: 0.1.13

# 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 All @@ -24,7 +24,7 @@ appVersion: "master"

dependencies:
- name: common
version: 0.1.10
version: 0.1.11
repository: file://../common
- name: postgresql
version: 11.9.13
Expand Down
15 changes: 9 additions & 6 deletions helm/audit/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# audit

![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.13](https://img.shields.io/badge/Version-0.1.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for Kubernetes

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| file://../common | common | 0.1.10 |
| file://../common | common | 0.1.11 |
| https://charts.bitnami.com/bitnami | postgresql | 11.9.13 |

## Values
Expand Down Expand Up @@ -119,10 +119,13 @@ A Helm chart for Kubernetes
| serviceAccount.annotations."eks.amazonaws.com/role-arn" | string | `nil` | The Amazon Resource Name (ARN) of the role to associate with the service account |
| serviceAccount.create | bool | `true` | Whether to create a service account |
| serviceAccount.name | string | `"audit-service-sa"` | The name of the service account |
| sidecar | map | `{"enabled":true,"image":"quay.io/cdis/nginx-sidecar","pullPolicy":"IfNotPresent","tag":"nginx-sidecar-feat_nginx-sidecar"}` | Configuration for Nginx sidecar container to be deployed with gunicorn. |
| sidecar.image | string | `"quay.io/cdis/nginx-sidecar"` | The Docker image repository for nginx |
| sidecar.pullPolicy | string | `"IfNotPresent"` | When to pull the image. |
| sidecar.tag | string | `"nginx-sidecar-feat_nginx-sidecar"` | Image tag. |
| slimImage | map | `{"enabled":false,"sidecar":{"enabled":false,"image":"quay.io/cdis/nginx-sidecar","pullPolicy":"IfNotPresent","tag":"nginx-sidecar-feat_nginx-sidecar"}}` | Configuration settings for the slim AL2 based image. |
| slimImage.enabled | bool | `false` | Enable the use of the slim AL2 based image. |
| slimImage.sidecar | map | `{"enabled":false,"image":"quay.io/cdis/nginx-sidecar","pullPolicy":"IfNotPresent","tag":"nginx-sidecar-feat_nginx-sidecar"}` | Configuration for Nginx sidecar container to be deployed with gunicorn. |
| slimImage.sidecar.enabled | bool | `false` | Enable the Nginx sidecar container. |
| slimImage.sidecar.image | string | `"quay.io/cdis/nginx-sidecar"` | The Docker image repository for nginx |
| slimImage.sidecar.pullPolicy | string | `"IfNotPresent"` | When to pull the image. |
| slimImage.sidecar.tag | string | `"nginx-sidecar-feat_nginx-sidecar"` | Image tag. |
| tolerations | list | `[]` | Tolerations for the pods |
| volumeMounts | list | `[]` | Volumes to mount to the container. |
| volumes | list | `[]` | Volumes to attach to the container. |
Expand Down
32 changes: 29 additions & 3 deletions helm/audit/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,63 @@ spec:
{{- include "common.datadogLabels" . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.slimImage.enabled }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
{{- end }}
serviceAccountName: {{ include "audit.serviceAccountName" . }}
volumes:
- name: config-volume
secret:
secretName: "audit-g3auto"
{{- if .Values.slimImage.enabled }}
- name: wsgi-config
configMap:
name: audit-wsgi
- name: nginx-config
configMap:
name: audit-nginx-configmap
{{- end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: audit
{{- if .Values.slimImage.enabled }}
image: "quay.io/cdis/audit-service:feat_GPE-1113"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
{{- if .Values.slimImage.enabled }}
- containerPort: 8000
{{- else }}
- containerPort: 80
{{- end }}
name: http
protocol: TCP
livenessProbe:
httpGet:
path: /_status
{{- if .Values.slimImage.enabled }}
port: 8000
{{- else }}
port: 80
{{- end }}
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /_status
{{- if .Values.slimImage.enabled }}
port: 8000
{{- else }}
port: 80
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
Expand Down Expand Up @@ -105,16 +125,18 @@ spec:
readOnly: true
mountPath: "/src/audit-service-config.yaml"
subPath: "audit-service-config.yaml"
{{- if .Values.slimImage.enabled }}
- name: "wsgi-config"
mountPath: "/audit-service/deployment/wsgi/gunicorn.conf.py"
subPath: gunicorn.conf.py
{{- end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.sidecar.enabled }}
{{- if .Values.slimImage.sidecar.enabled }}
- name: sidecar-nginx
image: {{ .Values.sidecar.image }}:{{ .Values.sidecar.tag }}
imagePullPolicy: {{ .Values.sidecar.pullPolicy }}
image: {{ .Values.slimImage.sidecar.image }}:{{ .Values.slimImage.sidecar.tag }}
imagePullPolicy: {{ .Values.slimImage.sidecar.pullPolicy }}
ports:
- name: http
containerPort: 8080
Expand All @@ -129,7 +151,11 @@ spec:
{{- end }}
initContainers:
- name: audit-init
{{- if .Values.slimImage.enabled }}
image: "quay.io/cdis/audit-service:feat_GPE-1113"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DB_HOST
Expand Down
23 changes: 14 additions & 9 deletions helm/audit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,20 @@ image:
# -- (string) Overrides the image tag whose default is the chart appVersion.
tag: "master"

# -- (map) Configuration for Nginx sidecar container to be deployed with gunicorn.
sidecar:
enabled: true
# -- (string) The Docker image repository for nginx
image: quay.io/cdis/nginx-sidecar
# -- (string) When to pull the image.
pullPolicy: IfNotPresent
# -- (string) Image tag.
tag: "nginx-sidecar-feat_nginx-sidecar"
# -- (map) Configuration settings for the slim AL2 based image.
slimImage:
# -- (bool) Enable the use of the slim AL2 based image.
enabled: false
# -- (map) Configuration for Nginx sidecar container to be deployed with gunicorn.
sidecar:
# -- (bool) Enable the Nginx sidecar container.
enabled: false
# -- (string) The Docker image repository for nginx
image: quay.io/cdis/nginx-sidecar
# -- (string) When to pull the image.
pullPolicy: IfNotPresent
# -- (string) Image tag.
tag: "nginx-sidecar-feat_nginx-sidecar"

# -- (list) Docker image pull secrets.
imagePullSecrets: []
Expand Down
2 changes: 1 addition & 1 deletion helm/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# 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.11
version: 0.1.12

# 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
2 changes: 1 addition & 1 deletion helm/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 0.1.11](https://img.shields.io/badge/Version-0.1.11-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for provisioning databases in gen3

Expand Down
2 changes: 1 addition & 1 deletion helm/fence/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.1.19
version: 0.1.20

# 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
8 changes: 4 additions & 4 deletions helm/fence/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fence

![Version: 0.1.19](https://img.shields.io/badge/Version-0.1.19-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.20](https://img.shields.io/badge/Version-0.1.20-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for gen3 Fence

Expand Down Expand Up @@ -135,7 +135,7 @@ A Helm chart for gen3 Fence
| global.syncFromDbgap | bool | `false` | Whether to sync data from dbGaP. |
| global.tierAccessLevel | string | `"libre"` | Access level for tiers. acceptable values for `tier_access_level` are: `libre`, `regular` and `private`. If omitted, by default common will be treated as `private` |
| global.tierAccessLimit | int | `"1000"` | Only relevant if tireAccessLevel is set to "regular". Summary charts below this limit will not appear for aggregated data. |
| image.pullPolicy | string | `"Always"` | When to pull the image. This value should be "Always" to ensure the latest image is used. |
| image.pullPolicy | string | `"IfNotPresent"` | When to pull the image. This value should be "Always" to ensure the latest image is used. |
| image.repository | string | `"quay.io/cdis/fence"` | The Docker image repository for the fence service |
| image.tag | string | `"master"` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | Docker image pull secrets. |
Expand Down Expand Up @@ -201,6 +201,6 @@ A Helm chart for gen3 Fence
| usersync.syncFromDbgap | bool | `false` | Whether to sync data from dbGaP. |
| usersync.userYamlS3Path | string | `"s3://cdis-gen3-users/helm-test/user.yaml"` | Path to the user.yaml file in S3. |
| usersync.usersync | bool | `true` | Whether to run Fence usersync or not. |
| volumeMounts | list | `[{"mountPath":"/var/www/fence/local_settings.py","name":"old-config-volume","readOnly":true,"subPath":"local_settings.py"},{"mountPath":"/var/www/fence/fence_credentials.json","name":"json-secret-volume","readOnly":true,"subPath":"fence_credentials.json"},{"mountPath":"/var/www/fence/creds.json","name":"creds-volume","readOnly":true,"subPath":"creds.json"},{"mountPath":"/var/www/fence/config_helper.py","name":"config-helper","readOnly":true,"subPath":"config_helper.py"},{"mountPath":"/fence/fence/static/img/logo.svg","name":"logo-volume","readOnly":true,"subPath":"logo.svg"},{"mountPath":"/fence/fence/static/privacy_policy.md","name":"privacy-policy","readOnly":true,"subPath":"privacy_policy.md"},{"mountPath":"/var/www/fence/fence-config-secret.yaml","name":"config-volume","readOnly":true,"subPath":"fence-config.yaml"},{"mountPath":"/var/www/fence/yaml_merge.py","name":"yaml-merge","readOnly":true,"subPath":"yaml_merge.py"},{"mountPath":"/var/www/fence/fence_google_app_creds_secret.json","name":"fence-google-app-creds-secret-volume","readOnly":true,"subPath":"fence_google_app_creds_secret.json"},{"mountPath":"/var/www/fence/fence_google_storage_creds_secret.json","name":"fence-google-storage-creds-secret-volume","readOnly":true,"subPath":"fence_google_storage_creds_secret.json"},{"mountPath":"/fence/keys/key/jwt_private_key.pem","name":"fence-jwt-keys","readOnly":true,"subPath":"jwt_private_key.pem"},{"mountPath":"/var/www/fence/fence-config-public.yaml","name":"config-volume-public","readOnly":true,"subPath":"fence-config-public.yaml"}]` | Volumes to mount to the container. |
| volumes | list | `[{"name":"old-config-volume","secret":{"secretName":"fence-secret"}},{"name":"json-secret-volume","secret":{"optional":true,"secretName":"fence-json-secret"}},{"name":"creds-volume","secret":{"secretName":"fence-creds"}},{"configMap":{"name":"config-helper","optional":true},"name":"config-helper"},{"configMap":{"name":"logo-config"},"name":"logo-volume"},{"name":"config-volume","secret":{"secretName":"fence-config"}},{"name":"fence-google-app-creds-secret-volume","secret":{"secretName":"fence-google-app-creds-secret"}},{"name":"fence-google-storage-creds-secret-volume","secret":{"secretName":"fence-google-storage-creds-secret"}},{"name":"fence-jwt-keys","secret":{"secretName":"fence-jwt-keys"}},{"configMap":{"name":"privacy-policy"},"name":"privacy-policy"},{"configMap":{"name":"fence-yaml-merge","optional":false},"name":"yaml-merge"},{"configMap":{"name":"manifest-fence","optional":true},"name":"config-volume-public"}]` | Volumes to attach to the container. |
| volumeMounts | list | `[{"mountPath":"/var/www/fence/local_settings.py","name":"old-config-volume","readOnly":true,"subPath":"local_settings.py"},{"mountPath":"/var/www/fence/fence_credentials.json","name":"json-secret-volume","readOnly":true,"subPath":"fence_credentials.json"},{"mountPath":"/var/www/fence/creds.json","name":"creds-volume","readOnly":true,"subPath":"creds.json"},{"mountPath":"/var/www/fence/config_helper.py","name":"config-helper","readOnly":true,"subPath":"config_helper.py"},{"mountPath":"/fence/fence/static/img/logo.svg","name":"logo-volume","readOnly":true,"subPath":"logo.svg"},{"mountPath":"/fence/fence/static/privacy_policy.md","name":"privacy-policy","readOnly":true,"subPath":"privacy_policy.md"},{"mountPath":"/var/www/fence/fence-config-secret.yaml","name":"config-volume","readOnly":true,"subPath":"fence-config.yaml"},{"mountPath":"/var/www/fence/yaml_merge.py","name":"yaml-merge","readOnly":true,"subPath":"yaml_merge.py"},{"mountPath":"/var/www/fence/fence_google_app_creds_secret.json","name":"fence-google-app-creds-secret-volume","readOnly":true,"subPath":"fence_google_app_creds_secret.json"},{"mountPath":"/var/www/fence/fence_google_storage_creds_secret.json","name":"fence-google-storage-creds-secret-volume","readOnly":true,"subPath":"fence_google_storage_creds_secret.json"},{"mountPath":"/fence/keys/key/jwt_private_key.pem","name":"fence-jwt-keys","readOnly":false,"subPath":"jwt_private_key.pem"},{"mountPath":"/var/www/fence/fence-config-public.yaml","name":"config-volume-public","readOnly":true,"subPath":"fence-config-public.yaml"}]` | Volumes to mount to the container. |
| volumes | list | `[{"name":"old-config-volume","secret":{"secretName":"fence-secret"}},{"name":"json-secret-volume","secret":{"optional":true,"secretName":"fence-json-secret"}},{"name":"creds-volume","secret":{"secretName":"fence-creds"}},{"configMap":{"name":"config-helper","optional":true},"name":"config-helper"},{"configMap":{"name":"logo-config"},"name":"logo-volume"},{"name":"config-volume","secret":{"secretName":"fence-config"}},{"name":"fence-google-app-creds-secret-volume","secret":{"secretName":"fence-google-app-creds-secret"}},{"name":"fence-google-storage-creds-secret-volume","secret":{"secretName":"fence-google-storage-creds-secret"}},{"name":"fence-jwt-keys","secret":{"secretName":"fence-jwt-keys"}},{"configMap":{"name":"privacy-policy"},"name":"privacy-policy"},{"configMap":{"name":"fence-yaml-merge","optional":false},"name":"yaml-merge"},{"configMap":{"name":"manifest-fence","optional":true},"name":"config-volume-public"},{"configMap":{"name":"fence-wsgi"},"name":"wsgi-config"},{"configMap":{"name":"fence-nginx-configmap"},"name":"nginx-config"}]` | Volumes to attach to the container. |

2 changes: 1 addition & 1 deletion helm/indexd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.1.14
version: 0.1.15

# 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
3 changes: 2 additions & 1 deletion helm/indexd/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# indexd

![Version: 0.1.14](https://img.shields.io/badge/Version-0.1.14-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.15](https://img.shields.io/badge/Version-0.1.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for gen3 indexd

Expand Down Expand Up @@ -107,6 +107,7 @@ A Helm chart for gen3 indexd
| sidecar.pullPolicy | string | `"IfNotPresent"` | When to pull the image. |
| sidecar.tag | string | `"nginx-sidecar-feat_nginx-sidecar"` | Image tag. |
| tolerations | list | `[]` | Tolerations for the pods |
| uwsgi | map | `{"listen":1024}` | Values for overriding uwsgi settings |
| volumeMounts | list | `[{"mountPath":"/var/www/indexd/local_settings.py","name":"config-volume","readOnly":true,"subPath":"local_settings.py"}]` | Volumes to mount to the container. |
| volumes | list | `[{"configMap":{"name":"indexd-wsgi"},"name":"wsgi-config"},{"name":"config-volume","secret":{"secretName":"indexd-settings"}},{"configMap":{"name":"indexd-nginx-configmap"},"name":"nginx-config"}]` | Volumes to attach to the pod |

2 changes: 1 addition & 1 deletion helm/manifestservice/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.1.14
version: 0.1.15

# 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
Loading

0 comments on commit a763e7d

Please sign in to comment.