-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding a deployment template to generate image name/tag with ab…
…ility to override the values
- Loading branch information
Showing
9 changed files
with
252 additions
and
5 deletions.
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ description: A Helm chart for Kubernetes | |
|
||
type: library | ||
|
||
version: 0.1.9 | ||
version: 0.2.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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://.. | ||
version: 0.1.8 | ||
digest: sha256:eee7e1ccb5821b28c6d01a54bdc5ff4a12887b1306b137d6a8b4610f71ed619a | ||
generated: "2024-12-09T16:40:26.404366+01:00" | ||
version: 0.2.0 | ||
digest: sha256:7954fcb7393cd799f0e93e9e6a4cf9ddfdd234136a449dbb0c656945fd090528 | ||
generated: "2024-12-13T08:25:57.253349+01:00" |
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 |
---|---|---|
|
@@ -25,5 +25,5 @@ appVersion: "1.16.0" | |
|
||
dependencies: | ||
- name: common | ||
version: 0.1.8 | ||
version: 0.2.0 | ||
repository: file://.. |
Binary file not shown.
Binary file not shown.
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,26 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "common.entity.name" . }} | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
revisionHistoryLimit: {{ include "common.getKeyValue" (dict "Values" .Values "key" "deployment.revisionHistoryLimit") }} | ||
selector: | ||
matchLabels: | ||
service: {{ include "common.entity.name" . }} | ||
template: | ||
metadata: | ||
spec: | ||
serviceAccountName: {{ include "common.entity.name" . }} | ||
containers: | ||
image: {{ include "common.image" . }} | ||
imagePullPolicy: {{ include "common.imagePullPolicy" . }} | ||
name: manager | ||
{{ include "common.container.securityContext" . | nindent 10 }} | ||
ports: | ||
{{ include "common.PortsMetricsHealth" . | nindent 10 }} | ||
{{ include "common.operatorHealthAndReadyness" . | nindent 10 }} | ||
{{ include "common.resources" . | nindent 10 }} | ||
terminationGracePeriodSeconds: {{ include "common.terminationGracePeriodSeconds" .}} |
177 changes: 177 additions & 0 deletions
177
charts/common/test-chart/tests/__snapshot__/deployment_test.yaml.snap
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,177 @@ | ||
test name override: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: RELEASE-NAME-test-chart | ||
spec: | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
service: RELEASE-NAME-test-chart | ||
template: | ||
metadata: null | ||
spec: | ||
containers: | ||
automountServiceAccountToken: true | ||
image: my-image:0.1.0 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 1 | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
periodSeconds: 10 | ||
name: manager | ||
ports: | ||
- containerPort: 8080 | ||
name: metrics | ||
protocol: TCP | ||
- containerPort: 8081 | ||
name: health-port | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 512Mi | ||
requests: | ||
cpu: 40m | ||
memory: 50Mi | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: RELEASE-NAME | ||
startupProbe: | ||
failureThreshold: 30 | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
periodSeconds: 10 | ||
serviceAccountName: RELEASE-NAME-test-chart | ||
terminationGracePeriodSeconds: 10 | ||
test tag default: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: RELEASE-NAME-test-chart | ||
spec: | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
service: RELEASE-NAME-test-chart | ||
template: | ||
metadata: null | ||
spec: | ||
containers: | ||
automountServiceAccountToken: true | ||
image: test-chart:0.1.0 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 1 | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
periodSeconds: 10 | ||
name: manager | ||
ports: | ||
- containerPort: 8080 | ||
name: metrics | ||
protocol: TCP | ||
- containerPort: 8081 | ||
name: health-port | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 512Mi | ||
requests: | ||
cpu: 40m | ||
memory: 50Mi | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: RELEASE-NAME | ||
startupProbe: | ||
failureThreshold: 30 | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
periodSeconds: 10 | ||
serviceAccountName: RELEASE-NAME-test-chart | ||
terminationGracePeriodSeconds: 10 | ||
test tag override: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: RELEASE-NAME-test-chart | ||
spec: | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
service: RELEASE-NAME-test-chart | ||
template: | ||
metadata: null | ||
spec: | ||
containers: | ||
automountServiceAccountToken: true | ||
image: test-chart:1.0.0 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 1 | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
periodSeconds: 10 | ||
name: manager | ||
ports: | ||
- containerPort: 8080 | ||
name: metrics | ||
protocol: TCP | ||
- containerPort: 8081 | ||
name: health-port | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 512Mi | ||
requests: | ||
cpu: 40m | ||
memory: 50Mi | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: RELEASE-NAME | ||
startupProbe: | ||
failureThreshold: 30 | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
periodSeconds: 10 | ||
serviceAccountName: RELEASE-NAME-test-chart | ||
terminationGracePeriodSeconds: 10 |
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 @@ | ||
suite: deployment | ||
templates: | ||
- deployment.yaml | ||
values: | ||
- ../values.yaml | ||
chart: | ||
namespace: default | ||
appVersion: 0.1.0 | ||
tests: | ||
- it: test tag default | ||
asserts: | ||
- matchSnapshot: {} | ||
- it: test tag override | ||
set: | ||
image: | ||
tag: 1.0.0 | ||
asserts: | ||
- matchSnapshot: {} | ||
- it: test name override | ||
set: | ||
image: | ||
name: my-image | ||
asserts: | ||
- matchSnapshot: {} |