Skip to content
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

Add Values.podLabels and Values.podAnnotations #217

Merged
merged 23 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a316966
Add terminationGracePeriodSeconds, podAnnotations, podLabels
vostres Apr 30, 2024
480e280
Merge remote-tracking branch 'origin/master' into feature/termination…
vostres Apr 30, 2024
02dc16f
Add podAnnotations, podLabels, terminationGracePeriodSeconds to value…
vostres Apr 30, 2024
5d560de
Refactor if-clauses to check Values.podAnnotations
vostres Apr 30, 2024
4419de0
Merge branch 'master' into feature/terminationGracePeriodSeconds
vostres May 7, 2024
761df1a
Remove logic for terminationGracePeriodSeconds
vostres May 7, 2024
da2982d
Add podAnnotations/Labels to producer-app-cleanup-job
vostres May 7, 2024
45788ad
Add podAnnotations/Labels to streams-app-cleanup-job
vostres May 7, 2024
5625c64
Add podAnnotations/Labels to producer-app
vostres May 7, 2024
df0abe9
Remove empty lines EOF
vostres May 7, 2024
a69d44b
Fix typo
vostres May 7, 2024
87c60fe
Update README.md for streams-app chart
vostres May 8, 2024
862fc1b
Update README.md for producer-app chart
vostres May 8, 2024
5796156
Add Values.annotations to the metadata for cleanup jobs
vostres May 8, 2024
a558bac
Remove Values.podAnnotations.consumerGroup
vostres May 13, 2024
29115dd
Add Values.annotations to job.yaml for producer-app
vostres May 13, 2024
a09ce6d
Update annotations/labels rclone-copy chart
vostres May 13, 2024
95932fb
Delete space
vostres May 13, 2024
d2eb12d
Add spaces to streams-app-cleanup-job chart
vostres May 13, 2024
327f824
Delete spaces
vostres May 13, 2024
7cfa7d8
Delete blank spaces before "-"
vostres May 13, 2024
b2599c3
Delete consumerGroup for pod
vostres May 13, 2024
af9af2e
Resolve merge conflicts
vostres May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions charts/producer-app-cleanup-job/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "producer-app-cleanup-job.fullname" . }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "producer-app-cleanup-job.name" . }}
chart: {{ template "producer-app-cleanup-job.chart" . }}
Expand All @@ -15,19 +21,19 @@ spec:
ttlSecondsAfterFinished: 30
template:
metadata:
{{- if or .Values.awsRole .Values.annotations }}
philipp94831 marked this conversation as resolved.
Show resolved Hide resolved
{{- if or .Values.awsRole .Values.podAnnotations }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
{{- end }}
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "producer-app-cleanup-job.name" . }}
release: {{ .Release.Name }}
{{- range $key, $value := .Values.labels }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/producer-app-cleanup-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ javaOptions:
# - "-XX:MinRAMPercentage=50.0"

backoffLimit: 6

podAnnotations: []

podLabels: []
8 changes: 5 additions & 3 deletions charts/producer-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Alternatively, a YAML file that specifies the values for the parameters can be p
### Job

| Parameter | Description | Default |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------------------------------------ |
| `nameOverride` | The name of the Kubernetes deployment. | `bakdata-producer-app` |
| `resources` | See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | see [values.yaml](values.yaml) for details |
| `annotations` | Map of custom annotations to attach to the pod spec. | `{}` |
| `labels` | Map of custom labels to attach to the pod spec. | `{}` |
| `annotations` | Map of custom annotations to attach to the deployment. | `{}` |
| `labels` | Map of custom labels to attach to the deployment. | `{}` |
| `tolerations` | Array containing taint references. When defined, pods can run on nodes, which would otherwise deny scheduling. Further information can be found in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `{}` |
| `nodeAffinity` | Map to configure [pod affinities](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity). | `{}` |
| `deployment` | Deploy the producer as a Kubernetes Deployment (thereby ignoring Job-related configurations) | false |
Expand All @@ -32,6 +32,8 @@ Alternatively, a YAML file that specifies the values for the parameters can be p
| `ports.servicePort` | Number of the port of the service (optional). See [service definition](#service) | |
| `livenessProbe` | Probe v1 definition for producer-app: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#probe-v1-core | `{}` |
| `readinessProbe` | Probe v1 definition for producer-app: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#probe-v1-core | `{}` |
| `podAnnotations` | Map of custom annotations to attach to the pod spec. | `[]` |
| `podLabels` | Map of custom labels to attach to the pod spec. | `[]` |

### Image

Expand Down
6 changes: 6 additions & 0 deletions charts/producer-app/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ kind: Job
{{- end }}
metadata:
name: {{ template "producer-app.fullname" . }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "producer-app.name" . }}
chart: {{ template "producer-app.chart" . }}
Expand Down
6 changes: 3 additions & 3 deletions charts/producer-app/templates/pod.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{{- define "producer-app.podTemplate" -}}
{{- $root := . -}}
metadata:
{{- if or .Values.awsRole .Values.annotations }}
vostres marked this conversation as resolved.
Show resolved Hide resolved
{{- if or .Values.awsRole .Values.podAnnotations }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
{{- end }}
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "producer-app.name" . }}
release: {{ .Release.Name }}
{{- range $key, $value := .Values.labels }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/producer-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ livenessProbe: {}

# Arbitrary Probe v1 definition for producer: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#probe-v1-core
readinessProbe: {}

podAnnotations: []

podLabels: []
12 changes: 9 additions & 3 deletions charts/rclone-copy/templates/rclone-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ template "rclone-copy.fullname" . }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "rclone-copy.name" . }}
chart: {{ template "rclone-copy.chart" . }}
Expand All @@ -23,19 +29,19 @@ spec:
spec:
template:
metadata:
{{- if or .Values.awsRole .Values.annotations }}
{{- if or .Values.awsRole .Values.podAnnotations }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
{{- end }}
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "rclone-copy.name" . }}
release: {{ .Release.Name }}
{{- range $key, $value := .Values.labels }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/rclone-copy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ resources:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
backoffLimit: 6

podAnnotations: []

podLabels: []
12 changes: 9 additions & 3 deletions charts/streams-app-cleanup-job/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "streams-app-cleanup-job.fullname" . }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "streams-app-cleanup-job.name" . }}
chart: {{ template "streams-app-cleanup-job.chart" . }}
Expand All @@ -15,19 +21,19 @@ spec:
ttlSecondsAfterFinished: 30
template:
metadata:
{{- if or .Values.awsRole .Values.annotations }}
philipp94831 marked this conversation as resolved.
Show resolved Hide resolved
{{- if or .Values.awsRole .Values.podAnnotations }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
{{- end }}
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "streams-app-cleanup-job.name" . }}
release: {{ .Release.Name }}
{{- range $key, $value := .Values.labels }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/streams-app-cleanup-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,7 @@ javaOptions:
# - "-XX:MinRAMPercentage=50.0"

backoffLimit: 6

podAnnotations: []

podLabels: []
8 changes: 5 additions & 3 deletions charts/streams-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Alternatively, a YAML file that specifies the values for the parameters can be p
### Deployment

| Parameter | Description | Default |
|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
|---------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `nameOverride` | The name of the Kubernetes deployment. | `bakdata-streams-app` |
| `replicaCount` | The number of Kafka Streams replicas. | `1` |
| `resources` | See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | see [values.yaml](values.yaml) for details |
| `annotations` | Map of custom annotations to attach to the pod spec. | `{}` |
| `labels` | Map of custom labels to attach to the pod spec. | `{}` |
| `annotations` | Map of custom annotations to attach to the deployment. | `{}` |
| `labels` | Map of custom labels to attach to the deployment. | `{}` |
| `tolerations` | Array containing taint references. When defined, pods can run on nodes, which would otherwise deny scheduling. Further information can be found in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `{}` |
| `statefulSet` | Whether to use a [Statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) instead of a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) to deploy the streams app. | `false` |
| `priorityClassName` | [Priority class name](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/) for the pod. | |
Expand All @@ -28,6 +28,8 @@ Alternatively, a YAML file that specifies the values for the parameters can be p
| `ports.servicePort` | Number of the port of the service (optional). See [service definition](#service) | |
| `livenessProbe` | Probe v1 definition for streams-app: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#probe-v1-core | `{}` |
| `readinessProbe` | Probe v1 definition for streams-app: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#probe-v1-core | `{}` |
| `podAnnotations` | Map of custom annotations to attach to the pod spec. | `[]` |
| `podLabels` | Map of custom labels to attach to the pod spec. | `[]` |
| `terminationGracePeriodSeconds` | Delay for graceful application shutdown in seconds: https://pracucci.com/graceful-shutdown-of-kubernetes-pods.html | `300` |

### Storage
Expand Down
9 changes: 3 additions & 6 deletions charts/streams-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
release: {{ .Release.Name }}
template:
metadata:
{{- if or (or (or .Values.awsRole .Values.prometheus.jmx.enabled) .Values.autoscaling.consumerGroup) .Values.annotations }}
{{- if or .Values.awsRole .Values.prometheus.jmx.enabled .Values.podAnnotations }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
Expand All @@ -48,17 +48,14 @@ spec:
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
{{- end }}
{{- range $key, $value := .Values.annotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- if and .Values.autoscaling.consumerGroup (not .Values.annotations.consumerGroup) }}
consumerGroup: {{ .Values.autoscaling.consumerGroup | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "streams-app.name" . }}
release: {{ .Release.Name }}
{{- range $key, $value := .Values.labels }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/streams-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,8 @@ persistence:
##
# storageClass: ""

podAnnotations: []

podLabels: []

terminationGracePeriodSeconds: 300
Loading