Skip to content

Commit

Permalink
Adds support for configuring imagePullSecrets in deployments (#116)
Browse files Browse the repository at this point in the history
* Adds support for configuring imagePullSecrets in deployments

* Adds support for configuring imagePullSecrets in deployments

---------

Co-authored-by: FelipeAFV <[email protected]>
  • Loading branch information
FelipeAFV and FelipeAFV authored May 20, 2024
1 parent ad9490e commit 8b929af
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| Key | Required | Description |
|:------------------------------------------|----------|------------------------------------------------------------------------|
| name | Yes | Use "Terrakube" |
| global.imagePullSecrets | No | Global Secret used to pull images from private repository |
| security.adminGroup | Yes | Admin group inside Terrakube |
| security.patSecret | Yes | 32 Character secret to sign personal access token |
| security.internalSecret | Yes | 32 Character secret to sing internal |
Expand Down Expand Up @@ -273,6 +274,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| api.properties.databasePassword | No | |
| api.securityContext | No | Fill securityContext field |
| api.containerSecurityContext | No | Fill securityContext field in the container spec |
| api.imagePullSecrets | No | Specific Secret used to pull images from private repository |
| executor.enabled | Yes | true/false |
| executor.image | No | Executor image repository |
| executor.version | Yes | Terrakube Executor version |
Expand All @@ -286,6 +288,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| executor.properties.toolsBranch | Yes | Example: main |
| executor.securityContext | No | Fill securityContext field |
| executor.containerSecurityContext | No | Fill securityContext field in the container spec |
| executor.imagePullSecrets | No | Specific Secret used to pull images from private repository |
| registry.enabled | Yes | |
| registry.image | No | Registry image repository |
| registry.version | Yes | |
Expand All @@ -297,6 +300,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| registry.volumeMounts | No | |
| registry.securityContext | No | Fill securityContext field |
| registry.containerSecurityContext | No | Fill securityContext field in the container spec |
| registry.imagePullSecrets | No | Specific Secret used to pull images from private repository |
| ui.enabled | Yes | true/false |
| ui.image | No | UI image repository |
| ui.version | Yes | |
Expand All @@ -305,6 +309,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| ui.serviceType | Yes | ClusterIP/NodePort/LoadBalancer/ExternalName |
| ui.securityContext | No | Fill securityContext field |
| ui.containerSecurityContext | No | Fill securityContext field in the container spec |
| ui.imagePullSecrets | No | Specific Secret used to pull images from private repository |
| ingress.ui.ingressClassName | Yes | Default is set to nginx |
| ingress.ui.useTls | Yes | true/false |
| ingress.ui.enabled | Yes | true/false |
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.16.2
version: 3.17.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
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 @@ -20,6 +20,10 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secrets-api.yaml") . | sha256sum }}
spec:
{{- with .Values.api.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: terrakube-api
image: {{ .Values.api.image }}:{{ default .Chart.AppVersion .Values.api.version }}
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 @@ -20,6 +20,10 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secrets-executor.yaml") . | sha256sum }}
spec:
{{- with .Values.executor.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: terrakube-executor
image: {{ .Values.executor.image }}:{{ default .Chart.AppVersion .Values.executor.version }}
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 @@ -20,6 +20,10 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secrets-registry.yaml") . | sha256sum }}
spec:
{{- with .Values.registry.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: terrakube-registry
image: {{ .Values.registry.image }}:{{ default .Chart.AppVersion .Values.registry.version }}
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 @@ -20,6 +20,10 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secrets-ui.yaml") . | sha256sum }}
spec:
{{- with .Values.ui.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: terrakube-ui
image: {{ .Values.ui.image }}:{{ default .Chart.AppVersion .Values.ui.version }}
Expand Down
7 changes: 7 additions & 0 deletions charts/terrakube/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Global Name
name: "terrakube"

global:
imagePullSecrets: []

## Azure Active Directory Security
security:
useOpenLDAP: true
Expand Down Expand Up @@ -176,6 +179,7 @@ api:
terraformReleasesUrl: "https://releases.hashicorp.com/terraform/index.json"
securityContext: {}
containerSecurityContext: {}
imagePullSecrets: []
cache:
moduleCacheMaxTotal: "128"
moduleCacheMaxIdle: "128"
Expand Down Expand Up @@ -217,6 +221,7 @@ executor:
toolsBranch: "main"
securityContext: {}
containerSecurityContext: {}
imagePullSecrets: []
## Registry properties
registry:
enabled: true
Expand All @@ -230,6 +235,7 @@ registry:
podLabels: {}
securityContext: {}
containerSecurityContext: {}
imagePullSecrets: []

## UI Properties
ui:
Expand All @@ -244,6 +250,7 @@ ui:
podLabels: {}
securityContext: {}
containerSecurityContext: {}
imagePullSecrets: []

## Ingress properties
ingress:
Expand Down

0 comments on commit 8b929af

Please sign in to comment.