Skip to content

Commit 50a13e0

Browse files
committed
adjust operator helm chart labels & resource names
Signed-off-by: André Bauer <[email protected]>
1 parent e5103bf commit 50a13e0

18 files changed

+201
-196
lines changed
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
apiVersion: v2
22
name: opensearch-operator
33
description: The OpenSearch Operator Helm chart for Kubernetes
4-
5-
# A chart can be either an 'application' or a 'library' chart.
6-
#
7-
# Application charts are a collection of templates that can be packaged into versioned archives
8-
# to be deployed.
9-
#
10-
# Library charts provide useful utilities or functions for the chart developer. They're included as
11-
# a dependency of application charts to inject those utilities and functions into the rendering
12-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
4+
home: https://opensearch.org
5+
sources:
6+
- https://github.com/opensearch-project/OpenSearch
7+
- https://github.com/opensearch-project/opensearch-k8s-operator
138
type: application
14-
15-
# This is the opensearch-operator chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 2.8.0
19-
20-
# This is the version number of the application being deployed (the operator). This version number should be
21-
# incremented each time you make changes to the application. Versions are not expected to
22-
# follow Semantic Versioning. They should reflect the version the application is using.
23-
# It is recommended to use it with quotes.
9+
version: 2.8.1
2410
appVersion: 2.8.0

charts/opensearch-operator/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@ The Operator can be easily installed using helm on any CNCF-certified Kubernetes
99
### Installation Using Helm
1010

1111
#### Get Repo Info
12-
```
12+
13+
```bash
1314
helm repo add opensearch-operator https://opensearch-project.github.io/opensearch-k8s-operator/
1415
helm repo update
1516
```
17+
1618
#### Install Chart
17-
```
19+
20+
```bash
1821
helm install [RELEASE_NAME] opensearch-operator/opensearch-operator
1922
```
23+
2024
#### Uninstall Chart
21-
```
25+
26+
```bash
2227
helm uninstall [RELEASE_NAME]
2328
```
29+
2430
#### Upgrade Chart
25-
```
31+
32+
```bash
2633
helm repo update
2734
helm upgrade [RELEASE_NAME] opensearch-operator/opensearch-operator
2835
```
29-

charts/opensearch-operator/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Create the name of the service account to use
5555
*/}}
5656
{{- define "opensearch-operator.serviceAccountName" -}}
5757
{{- if .Values.serviceAccount.create }}
58-
{{- default (printf "%s-%s" (include "opensearch-operator.fullname" .) "controller-manager") .Values.serviceAccount.name }}
58+
{{- default (include "opensearch-operator.fullname" .) .Values.serviceAccount.name }}
5959
{{- else }}
60-
{{- default "opensearch-operator-controller-manager" .Values.serviceAccount.name }}
60+
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
---
12
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "opensearch-operator.fullname" . }}
6+
labels:
7+
{{- include "opensearch-operator.labels" . | nindent 4 }}
28
data:
39
controller_manager_config.yaml: |
410
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
@@ -12,6 +18,3 @@ data:
1218
leaderElection:
1319
leaderElect: true
1420
resourceName: a867c7dc.opensearch.opster.io
15-
kind: ConfigMap
16-
metadata:
17-
name: {{ include "opensearch-operator.fullname" . }}-manager-config
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.installCRDs -}}
2+
{{- range $path, $_ := .Files.Glob "files/*.yaml" }}
3+
{{- $raw := $.Files.Get $path -}}
4+
{{- $docs := splitList "\n---\n" $raw -}}
5+
{{- range $doc := $docs }}
6+
{{- if and $doc (ne $doc "") }}
7+
{{- $obj := fromYaml $doc }}
8+
{{- if $obj }}
9+
{{- $labels := include "opensearch-operator.labels" $ | fromYaml }}
10+
{{- $md := default (dict) $obj.metadata }}
11+
{{- $_ := set $md "labels" (merge (default (dict) $obj.metadata.labels) $labels) }}
12+
{{- $_ := set $obj "metadata" $md }}
13+
{{ $obj | toYaml }}
14+
---
15+
{{- end }}
16+
{{- end }}
17+
{{- end }}
18+
{{- end }}
19+
{{- end }}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
---
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
45
labels:
5-
control-plane: controller-manager
6-
name: {{ include "opensearch-operator.fullname" . }}-controller-manager
6+
{{- include "opensearch-operator.labels" . | nindent 4 }}
7+
name: {{ include "opensearch-operator.fullname" . }}
78
spec:
89
replicas: 1
910
selector:
1011
matchLabels:
11-
control-plane: controller-manager
12+
{{- include "opensearch-operator.selectorLabels" . | nindent 6 }}
1213
template:
1314
metadata:
1415
labels:
15-
control-plane: controller-manager
16+
{{- include "opensearch-operator.labels" . | nindent 8 }}
1617
{{- with .Values.podLabels }}
1718
{{- toYaml . | nindent 8 }}
1819
{{- end }}

charts/opensearch-operator/templates/opensearch-operator-controller-manager-metrics-service-svc.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

charts/opensearch-operator/templates/opensearch-operator-crds.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

charts/opensearch-operator/templates/opensearch-operator-leader-election-role-role.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

charts/opensearch-operator/templates/opensearch-operator-leader-election-rolebinding-rb.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)