Skip to content

Commit a21f278

Browse files
feat: Custom labels and annotations for namespace. (#702)
Signed-off-by: Christopher Pitstick <[email protected]>
1 parent 1588ef8 commit a21f278

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

Diff for: chart/open-feature-operator/README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,20 @@ The command removes all the Kubernetes components associated with the chart and
9393

9494
### Global
9595

96-
| Name | Description | Value |
97-
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
98-
| `defaultNamespace` | To override the namespace use the `--namespace` flag. This default is provided to ensure that the kustomize build charts in `/templates` deploy correctly when no `namespace` is provided via the `-n` flag. | `open-feature-operator-system` |
99-
| `imagePullSecrets` | Array of ImagePullSecret objects containing credentials for images pulled by the operator (flagdProxyConfiguration.image, flagdConfiguration.image, controllerManager.manager.image, controllerManager.kubeRbacProxy.image). Example: imagePullSecrets: [{"name": "my-secret"}] | `[]` |
100-
| `labels` | Labels to apply to all of the pods in the operator. | `{}` |
101-
| `annotations` | Annotations to apply to all of the pods in the operator. | `{}` |
96+
| Name | Description | Value |
97+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
98+
| `defaultNamespace` | To override the namespace use the `--namespace` flag. This default is provided to ensure that the kustomize build charts in `/templates` deploy correctly when no `namespace` is provided via the `-n` flag. | `open-feature-operator-system` |
99+
100+
### namespace
101+
102+
| Name | Description | Value |
103+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
104+
| `namespace.create` | Whether to create the namespace as part of this chart. | `true` |
105+
| `namespace.labels` | Labels for the namespace if created as part of the chart. | `{}` |
106+
| `namespace.annotations` | Annotations for the namespace if created as part of the chart. | `{}` |
107+
| `imagePullSecrets` | Array of ImagePullSecret objects containing credentials for images pulled by the operator (flagdProxyConfiguration.image, flagdConfiguration.image, controllerManager.manager.image, controllerManager.kubeRbacProxy.image). Example: imagePullSecrets: [{"name": "my-secret"}] | `[]` |
108+
| `labels` | Labels to apply to all of the pods in the operator. | `{}` |
109+
| `annotations` | Annotations to apply to all of the pods in the operator. | `{}` |
102110

103111
### Sidecar configuration
104112

Diff for: chart/open-feature-operator/templates/namespace.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# Only deploy the namespace if the default is being used (helm install should fail if the namespace isnt present)
22
# when one is defined with -n
3-
{{ if eq ( include "chart.namespace" . ) .Values.defaultNamespace }}
3+
{{- if and (eq (include "chart.namespace" .) .Values.defaultNamespace) .Values.namespace.create }}
44
apiVersion: v1
55
kind: Namespace
66
metadata:
7+
name: '{{ include "chart.namespace" . }}'
78
labels:
89
control-plane: controller-manager
9-
name: '{{ include "chart.namespace" . }}'
10-
{{ end }}
10+
{{- range $key, $value := $.Values.namespace.labels }}
11+
{{ $key }}: {{ $value | quote }}
12+
{{- end }}
13+
annotations:
14+
{{- range $key, $value := $.Values.namespace.annotations }}
15+
{{ $key }}: {{ $value | quote }}
16+
{{- end }}
17+
{{ end }}

Diff for: chart/open-feature-operator/values.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
## @section Global
33
## @param defaultNamespace To override the namespace use the `--namespace` flag. This default is provided to ensure that the kustomize build charts in `/templates` deploy correctly when no `namespace` is provided via the `-n` flag.
44
defaultNamespace: open-feature-operator-system
5+
## @section namespace
6+
namespace:
7+
## @param namespace.create Whether to create the namespace as part of this chart.
8+
create: true
9+
## @param namespace.labels Labels for the namespace if created as part of the chart.
10+
labels: {}
11+
## @param namespace.annotations Annotations for the namespace if created as part of the chart.
12+
annotations: {}
13+
514
## @param imagePullSecrets Array of ImagePullSecret objects containing credentials for images pulled by the operator (flagdProxyConfiguration.image, flagdConfiguration.image, controllerManager.manager.image, controllerManager.kubeRbacProxy.image). Example: imagePullSecrets: [{"name": "my-secret"}]
615
imagePullSecrets: []
716
## @param labels Labels to apply to all of the pods in the operator.

0 commit comments

Comments
 (0)