Skip to content

Commit

Permalink
Allow adding custom annotations and labels to the k8gb controller (#1704
Browse files Browse the repository at this point in the history
)

I just faced a usecase where I needed to add an istio expection on the k8gb controller via an annotation. However, the chart did not allow it.
This PR also allows adding custom labels since this feature may be desired for other usecases.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
  • Loading branch information
abaguas committed Aug 29, 2024
1 parent f2f5731 commit c377966
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chart/k8gb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ For Kubernetes `< 1.19` use this chart and k8gb in version `0.8.8` or lower.
| k8gb.log.format | string | `"simple"` | log format (simple,json) |
| k8gb.log.level | string | `"info"` | log level (panic,fatal,error,warn,info,debug,trace) |
| k8gb.metricsAddress | string | `"0.0.0.0:8080"` | Metrics server address |
| k8gb.podAnnotations | object | `{}` | pod annotations |
| k8gb.podLabels | object | `{}` | pod labels |
| k8gb.reconcileRequeueSeconds | int | `30` | Reconcile time in seconds |
| k8gb.securityContext.allowPrivilegeEscalation | bool | `false` | |
| k8gb.securityContext.readOnlyRootFilesystem | bool | `true` | |
Expand Down
6 changes: 6 additions & 0 deletions chart/k8gb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ spec:
metadata:
labels:
name: k8gb
{{- with .Values.k8gb.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
kubectl.kubernetes.io/default-container: k8gb
{{- with .Values.k8gb.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: k8gb
containers:
Expand Down
6 changes: 6 additions & 0 deletions chart/k8gb/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@
},
"serviceMonitor": {
"$ref": "#/definitions/k8gbServiceMonitor"
},
"podAnnotations": {
"type": "object"
},
"podLabels": {
"type": "object"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions chart/k8gb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ k8gb:
# -- enable ServiceMonitor
serviceMonitor:
enabled: false
# -- pod annotations
podAnnotations: {}
# -- pod labels
podLabels: {}

externaldns:
# -- `.spec.template.spec.dnsPolicy` for ExternalDNS deployment
Expand Down

0 comments on commit c377966

Please sign in to comment.