Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 38995da

Browse files
alejandroEsck8s-ci-robot
authored andcommitted
[stable/etcd-operator] changes to account for current v0.7.0 (helm#2826)
* major changes included to allow for backup, restore, and etcd operator deployments. This also includes deployments allowing for tls. Should be easier to understand what each piece means now. helm lint ran almost got restore, complete, for some reason container cannot conntact the right service. renamed items, fixed restore svc and got it working properly. * fixed naming issue. * updated deployments for restore and back up and updates readme and some adjustments to values.yaml * reduced empty lines in values.yaml file * updated values so as not to try to deploy etcd cluster resource by default. * changes based on PR comments and rbac standards. * added names to backup and restore operators * readmefile updated * updated documentation regarding rbac * changed serviceaccount fields for deployments to use template full name or name found in values file. * rback service name changes revisited
1 parent 2102933 commit 38995da

23 files changed

+585
-247
lines changed

stable/etcd-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
description: CoreOS etcd-operator Helm chart for Kubernetes
33
name: etcd-operator
4-
version: 0.5.2
5-
appVersion: 0.6.1
4+
version: 0.6.0
5+
appVersion: 0.7.0
66
home: https://github.com/coreos/etcd-operator
77
icon: https://raw.githubusercontent.com/coreos/etcd/master/logos/etcd-horizontal-color.png
88
sources:

stable/etcd-operator/README.md

Lines changed: 63 additions & 34 deletions
Large diffs are not rendered by default.

stable/etcd-operator/templates/NOTES.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{{- $clusterEnabled := (and (not .Release.IsInstall) .Values.cluster.enabled) -}}
2-
{{- if and .Release.IsInstall .Values.cluster.enabled -}}
1+
{{- $clusterEnabled := (and (not .Release.IsInstall) .Values.customResources.createEtcdClusterCRD) -}}
2+
{{- if and .Release.IsInstall .Values.customResources.createEtcdClusterCRD -}}
33
Not enabling cluster, the ThirdPartResource must be installed before you can create a Cluster. Continuing rest of normal deployment.
44

55
{{ end -}}
66

77
{{- if $clusterEnabled -}}
88
1. Watch etcd cluster start
9-
kubectl get pods -l etcd_cluster={{ .Values.cluster.name }} --namespace {{ .Release.Namespace }} -w
9+
kubectl get pods -l etcd_cluster={{ .Values.etcdCluster.name }} --namespace {{ .Release.Namespace }} -w
1010
2. Confirm etcd cluster is healthy
11-
$ kubectl run --rm -i --tty --env="ETCDCTL_API=3" --env="ETCDCTL_ENDPOINTS=http://{{ .Values.cluster.name }}-client:2379" etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh -c 'watch -n1 "etcdctl member list"'
11+
$ kubectl run --rm -i --tty --env="ETCDCTL_API=3" --env="ETCDCTL_ENDPOINTS=http://{{ .Values.etcdCluster.name }}-client:2379" etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh -c 'watch -n1 "etcdctl member list"'
1212

1313
3. Interact with the cluster!
1414
$ kubectl run --rm -i --tty --env ETCDCTL_API=3 etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh
15-
/ # etcdctl --endpoints http://{{ .Values.cluster.name }}-client:2379 put foo bar
16-
/ # etcdctl --endpoints http://{{ .Values.cluster.name }}-client:2379 get foo
15+
/ # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 put foo bar
16+
/ # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 get foo
1717
OK
1818
(ctrl-D to exit)
1919
4. Optional

stable/etcd-operator/templates/_helpers.tpl

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,31 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
1212
*/}}
1313
{{- define "etcd-operator.fullname" -}}
1414
{{- $name := default .Chart.Name .Values.nameOverride -}}
15-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
15+
{{- printf "%s-%s-%s" .Release.Name $name .Values.etcdOperator.name | trunc 63 | trimSuffix "-" -}}
16+
{{- end -}}
17+
18+
{{- define "etcd-backup-operator.name" -}}
19+
{{- default .Chart.Name .Values.backupOperator.name | trunc 63 | trimSuffix "-" -}}
20+
{{- end -}}
21+
22+
{{/*
23+
Create a default fully qualified app name.
24+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
25+
*/}}
26+
{{- define "etcd-backup-operator.fullname" -}}
27+
{{- $name := default .Chart.Name .Values.nameOverride -}}
28+
{{- printf "%s-%s-%s" .Release.Name $name .Values.backupOperator.name | trunc 63 | trimSuffix "-" -}}
29+
{{- end -}}
30+
31+
{{- define "etcd-restore-operator.name" -}}
32+
{{- default .Chart.Name .Values.restoreOperator.name | trunc 63 | trimSuffix "-" -}}
33+
{{- end -}}
34+
35+
{{/*
36+
Create a default fully qualified app name.
37+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
38+
*/}}
39+
{{- define "etcd-restore-operator.fullname" -}}
40+
{{- $name := default .Chart.Name .Values.nameOverride -}}
41+
{{- printf "%s-%s-%s" .Release.Name $name .Values.restoreOperator.name | trunc 63 | trimSuffix "-" -}}
1642
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.customResources.createBackupCRD }}
2+
---
3+
apiVersion: "etcd.database.coreos.com/v1beta2"
4+
kind: "EtcdBackup"
5+
metadata:
6+
name: {{ template "etcd-backup-operator.fullname" . }}
7+
labels:
8+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9+
app: {{ template "etcd-backup-operator.name" . }}
10+
heritage: {{ .Release.Service }}
11+
release: {{ .Release.Name }}
12+
13+
spec:
14+
clusterName: {{ .Values.etcdCluster.name }}
15+
{{ toYaml .Values.backupOperator.spec | indent 2 }}
16+
{{- end}}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if and .Values.rbac.create .Values.deployments.backupOperator }}
2+
---
3+
kind: ClusterRoleBinding
4+
apiVersion: rbac.authorization.k8s.io/{{ .Values.rbac.apiVersion }}
5+
metadata:
6+
name: {{ template "etcd-backup-operator.fullname" . }}
7+
labels:
8+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9+
app: {{ template "etcd-operator.name" . }}
10+
heritage: {{ .Release.Service }}
11+
release: {{ .Release.Name }}
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ .Values.rbac.backupOperatorServiceAccountName }}
15+
namespace: {{ .Release.Namespace }}
16+
roleRef:
17+
apiGroup: rbac.authorization.k8s.io
18+
kind: ClusterRole
19+
name: {{ template "etcd-operator.fullname" . }}
20+
{{- end }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{- if .Values.deployments.backupOperator }}
2+
---
3+
apiVersion: apps/v1beta1
4+
kind: Deployment
5+
metadata:
6+
name: {{ template "etcd-backup-operator.fullname" . }}
7+
labels:
8+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9+
app: {{ template "etcd-backup-operator.name" . }}
10+
heritage: {{ .Release.Service }}
11+
release: {{ .Release.Name }}
12+
spec:
13+
replicas: {{ .Values.backupOperator.replicaCount }}
14+
template:
15+
metadata:
16+
name: {{ template "etcd-backup-operator.fullname" . }}
17+
labels:
18+
app: {{ template "etcd-backup-operator.fullname" . }}
19+
release: {{ .Release.Name }}
20+
spec:
21+
serviceAccountName: {{ if .Values.rbac.create }}{{ template "etcd-backup-operator.fullname" . }}{{ else }}{{ .Values.rbac.backupOperatorServiceAccountName }}{{ end }}
22+
containers:
23+
- name: {{ .Values.backupOperator.name }}
24+
image: "{{ .Values.backupOperator.image.repository }}:{{ .Values.backupOperator.image.tag }}"
25+
imagePullPolicy: {{ .Values.backupOperator.image.pullPolicy }}
26+
command:
27+
- etcd-backup-operator
28+
{{- range $key, $value := .Values.backupOperator.commandArgs }}
29+
- "--{{ $key }}={{ $value }}"
30+
{{- end }}
31+
env:
32+
- name: MY_POD_NAMESPACE
33+
valueFrom:
34+
fieldRef:
35+
fieldPath: metadata.namespace
36+
- name: MY_POD_NAME
37+
valueFrom:
38+
fieldRef:
39+
fieldPath: metadata.name
40+
resources:
41+
limits:
42+
cpu: {{ .Values.backupOperator.resources.cpu }}
43+
memory: {{ .Values.backupOperator.resources.memory }}
44+
requests:
45+
cpu: {{ .Values.backupOperator.resources.cpu }}
46+
memory: {{ .Values.backupOperator.resources.memory }}
47+
{{- if .Values.backupOperator.nodeSelector }}
48+
nodeSelector:
49+
{{ toYaml .Values.backupOperator.nodeSelector | indent 8 }}
50+
{{- end }}
51+
{{- end}}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if and .Values.rbac.create .Values.deployments.backupOperator }}
2+
---
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
name: {{ template "etcd-backup-operator.fullname" . }}
7+
labels:
8+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9+
app: {{ template "etcd-backup-operator.name" . }}
10+
heritage: {{ .Release.Service }}
11+
release: {{ .Release.Name }}
12+
{{- end }}

stable/etcd-operator/templates/cluster.yaml

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

stable/etcd-operator/templates/deployment.yaml

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

0 commit comments

Comments
 (0)