Skip to content

Commit

Permalink
Feature/add containers security context field (#98)
Browse files Browse the repository at this point in the history
* #96 Adding securityContext in the containers spec field to deployment templates

* #96 Adding securityContext in the containers spec field to deployment templates
  • Loading branch information
Edu-DevOps authored Feb 21, 2024
1 parent 12a9dc0 commit 55815e6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| api.properties.databaseUser | No | |
| api.properties.databasePassword | No | |
| api.securityContext | No | Fill securityContext field |
| api.containerSecurityContext | No | Fill securityContext field in the container spec |
| executor.enabled | Yes | true/false |
| executor.version | Yes | Terrakube Executor version |
| executor.replicaCount | Yes | |
Expand All @@ -282,6 +283,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| executor.properties.toolsRepository | Yes | Example: https://github.com/AzBuilder/terrakube-extensions |
| executor.properties.toolsBranch | Yes | Example: main |
| executor.securityContext | No | Fill securityContext field |
| executor.containerSecurityContext | No | Fill securityContext field in the container spec |
| registry.enabled | Yes | |
| registry.version | Yes | |
| registry.replicaCount | Yes | |
Expand All @@ -291,12 +293,14 @@ Once you have completed the above steps you can complete the file values.yaml to
| registry.volumes | No | |
| registry.volumeMounts | No | |
| registry.securityContext | No | Fill securityContext field |
| registry.containerSecurityContext | No | Fill securityContext field in the container spec |
| ui.enabled | Yes | true/false |
| ui.version | Yes | |
| ui.replicaCount | Yes | |
| ui.serviceAccountName | No | Kubernetes Service Account name |
| ui.serviceType | Yes | ClusterIP/NodePort/LoadBalancer/ExternalName |
| ui.securityContext | No | Fill securityContext field |
| ui.containerSecurityContext | No | Fill securityContext field in the container spec |
| ingress.ui.useTls | Yes | true/false |
| ingress.ui.enabled | Yes | true/false |
| ingress.ui.domain | Yes | |
Expand Down
2 changes: 1 addition & 1 deletion charts/terrakube/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: 3.14.1
version: 3.14.2

# 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
4 changes: 4 additions & 0 deletions charts/terrakube/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
port: 8080
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.api.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.api.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/terrakube/templates/deployment-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
port: 8090
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.executor.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.executor.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/terrakube/templates/deployment-openldap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ spec:
mountPath: "/ldifs/config-ldap.ldif"
subPath: "config-ldap.ldif"
readOnly: true
{{- with .Values.executor.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
volumes:
- name: openldap-config
secret:
Expand Down
4 changes: 4 additions & 0 deletions charts/terrakube/templates/deployment-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
port: 8075
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.executor.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.registry.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/terrakube/templates/deployment-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
envFrom:
- secretRef:
name: terrakube-ui-secrets
{{- with .Values.executor.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.ui.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/terrakube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ security:
openldap:
podLabels: {}
securityContext: {}
containerSecurityContext: {}

## Dex
dex:
Expand Down Expand Up @@ -173,6 +174,7 @@ api:
loadSampleData: true
terraformReleasesUrl: "https://releases.hashicorp.com/terraform/index.json"
securityContext: {}
containerSecurityContext: {}
cache:
moduleCacheMaxTotal: "128"
moduleCacheMaxIdle: "128"
Expand Down Expand Up @@ -210,6 +212,7 @@ executor:
toolsRepository: "https://github.com/AzBuilder/terrakube-extensions"
toolsBranch: "main"
securityContext: {}
containerSecurityContext: {}
## Registry properties
registry:
enabled: true
Expand All @@ -221,6 +224,7 @@ registry:
resources: {}
podLabels: {}
securityContext: {}
containerSecurityContext: {}

## UI Properties
ui:
Expand All @@ -233,6 +237,7 @@ ui:
resources: {}
podLabels: {}
securityContext: {}
containerSecurityContext: {}

## Ingress properties
ingress:
Expand Down

0 comments on commit 55815e6

Please sign in to comment.