Skip to content

Commit 81100c9

Browse files
committed
[etcd-operator] helm chart
1 parent 0049f0b commit 81100c9

20 files changed

+693
-0
lines changed

helm/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

helm/Chart.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: v2
2+
name: etcd-operator
3+
description: The official Kubernetes operator for etcd.
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.
13+
type: application
14+
15+
# This is the 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+
19+
# This is the version number of the application being deployed. This version number should be
20+
# incremented each time you make changes to the application. Versions are not expected to
21+
# follow Semantic Versioning. They should reflect the version the application is using.
22+
# Same value as in values.yml#image.tag
23+
24+
icon: https://avatars.githubusercontent.com/u/41972792?s=48&v=4
25+
26+
home: https://github.com/etcd-io/etcd-operator/tree/main
27+
sources:
28+
- https://github.com/luismacosta/etcd-operator/helm
29+
30+
maintainers:
31+
- name: etcd-io
32+
33+
appVersion: v3.5.18
34+
version: 3.5.18

helm/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# etcd-operator
2+
3+
![Version: 3.5.18](https://img.shields.io/badge/Version-3.5.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v3.5.18](https://img.shields.io/badge/AppVersion-v3.5.18-informational?style=flat-square)
4+
5+
The official Kubernetes operator for etcd.
6+
7+
**Homepage:** <https://github.com/etcd-io/etcd-operator/tree/main>
8+
9+
## Maintainers
10+
11+
| Name | Email | Url |
12+
| ---- | ------ | --- |
13+
| etcd-io | | |
14+
15+
## Source Code
16+
17+
* <https://github.com/luismacosta/etcd-operator/helm>
18+
19+
## Values
20+
21+
| Key | Type | Default | Description |
22+
|-----|------|---------|-------------|
23+
| affinity | object | `{}` | |
24+
| annotations | object | `{}` | |
25+
| commonLabels | object | `{}` | Labels that get applied to every resource's metadata |
26+
| image.repository | string | `"quay.io/coreos/etcd"` | |
27+
| image.tag | string | `"v3.5.18"` | |
28+
| livenessProbe.failureThreshold | int | `3` | |
29+
| livenessProbe.initialDelaySeconds | int | `15` | |
30+
| livenessProbe.periodSeconds | int | `20` | |
31+
| livenessProbe.port | int | `8081` | |
32+
| livenessProbe.timeoutSeconds | int | `1` | |
33+
| manager.replicas | int | `1` | |
34+
| podAnnotations | object | `{}` | |
35+
| podSecurityContext | object | `{}` | [Pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) configuration. To remove the default, set it to null (or `~`). |
36+
| prometheus.enabled | bool | `false` | |
37+
| readinessProbe.failureThreshold | int | `12` | |
38+
| readinessProbe.initialDelaySeconds | int | `5` | |
39+
| readinessProbe.periodSeconds | int | `10` | |
40+
| readinessProbe.port | int | `8081` | |
41+
| readinessProbe.timeoutSeconds | int | `1` | |
42+
| resources.limits.cpu | string | `"500m"` | |
43+
| resources.limits.memory | string | `"128Mi"` | |
44+
| resources.requests.cpu | string | `"10m"` | |
45+
| resources.requests.memory | string | `"64Mi"` | |
46+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
47+
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
48+
| serviceAccount.name | string | `"controller-manager"` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
49+
| terminationGracePeriodSeconds | int | `10` | |
50+
51+
----------------------------------------------
52+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.2
7+
name: etcdclusters.operator.etcd.io
8+
spec:
9+
group: operator.etcd.io
10+
names:
11+
kind: EtcdCluster
12+
listKind: EtcdClusterList
13+
plural: etcdclusters
14+
singular: etcdcluster
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: EtcdCluster is the Schema for the etcdclusters API.
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: EtcdClusterSpec defines the desired state of EtcdCluster.
41+
properties:
42+
size:
43+
description: Size is the expected size of the etcd cluster.
44+
type: integer
45+
storageSpec:
46+
description: StorageSpec is the name of the StorageSpec to use for
47+
the etcd cluster. If not provided, then each POD just uses the temporary
48+
storage inside the container.
49+
properties:
50+
accessModes:
51+
type: string
52+
pvcName:
53+
type: string
54+
storageClassName:
55+
type: string
56+
volumeSizeLimit:
57+
anyOf:
58+
- type: integer
59+
- type: string
60+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
61+
x-kubernetes-int-or-string: true
62+
volumeSizeRequest:
63+
anyOf:
64+
- type: integer
65+
- type: string
66+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
67+
x-kubernetes-int-or-string: true
68+
required:
69+
- volumeSizeRequest
70+
type: object
71+
tls:
72+
description: TLS is the TLS certificate configuration to use for the
73+
etcd cluster and etcd operator.
74+
properties:
75+
provider:
76+
type: string
77+
providerCfg:
78+
properties:
79+
autoCfg:
80+
type: object
81+
certManagerCfg:
82+
type: object
83+
type: object
84+
type: object
85+
version:
86+
description: Version is the expected version of the etcd container
87+
image.
88+
type: string
89+
required:
90+
- size
91+
- version
92+
type: object
93+
status:
94+
description: EtcdClusterStatus defines the observed state of EtcdCluster.
95+
type: object
96+
type: object
97+
served: true
98+
storage: true
99+
subresources:
100+
status: {}

helm/templates/_helpers.tpl

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "etcd-operator.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- end }}
8+
9+
{{/*
10+
Create chart name and version as used by the chart label.
11+
*/}}
12+
{{- define "etcd-operator.chart" -}}
13+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
14+
{{- end }}
15+
16+
{{/*
17+
Create the name of the service account to use
18+
*/}}
19+
{{- define "etcd-operator.serviceAccountName" -}}
20+
{{- if .Values.serviceAccount.create }}
21+
{{- default (include "etcd-operator.fullname" .) .Values.serviceAccount.name }}
22+
{{- else }}
23+
{{- default "default" .Values.serviceAccount.name }}
24+
{{- end }}
25+
{{- end }}
26+
27+
{{/*
28+
Selector labels
29+
*/}}
30+
{{- define "etcd-operator.selectorLabels" -}}
31+
app.kubernetes.io/name: {{ include "etcd-operator.name" . }}
32+
app.kubernetes.io/instance: {{ .Release.Name }}
33+
{{- end }}
34+
35+
{{/*
36+
Common labels
37+
*/}}
38+
{{- define "etcd-operator.labels" -}}
39+
helm.sh/chart: {{ include "etcd-operator.chart" . }}
40+
{{ include "etcd-operator.selectorLabels" . }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- if .Values.commonLabels }}
46+
{{ tpl (toYaml .Values.commonLabels) . }}
47+
{{- end }}
48+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
control-plane: controller-manager
6+
app.kubernetes.io/name: etcd-operator
7+
name: controller-manager-metrics-service
8+
namespace: {{ .Release.Namespace }}
9+
spec:
10+
ports:
11+
- name: https
12+
port: 8443
13+
protocol: TCP
14+
targetPort: 8443
15+
selector:
16+
control-plane: controller-manager

helm/templates/manager/manager.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: controller-manager
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
control-plane: controller-manager
8+
app.kubernetes.io/name: etcd-operator
9+
{{- include "etcd-operator.labels" . | nindent 4 }}
10+
annotations:
11+
{{- toYaml .Values.annotations | nindent 4 }}
12+
spec:
13+
selector:
14+
matchLabels:
15+
control-plane: controller-manager
16+
{{- include "etcd-operator.selectorLabels" . | nindent 6 }}
17+
replicas: {{ .Values.manager.replicas }}
18+
template:
19+
metadata:
20+
annotations:
21+
kubectl.kubernetes.io/default-container: manager
22+
{{- with .Values.podAnnotations }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
labels:
26+
control-plane: controller-manager
27+
{{- include "etcd-operator.labels" . | nindent 8 }}
28+
spec:
29+
{{- with .Values.affinity }}
30+
affinity:
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
33+
securityContext:
34+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
35+
containers:
36+
- command:
37+
- /manager
38+
args:
39+
- --leader-elect
40+
- --health-probe-bind-address=:8081
41+
image: controller:latest
42+
name: manager
43+
securityContext:
44+
allowPrivilegeEscalation: false
45+
capabilities:
46+
drop:
47+
- "ALL"
48+
livenessProbe:
49+
httpGet:
50+
path: /healthz
51+
port: {{ .Values.livenessProbe.port }}
52+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
53+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
54+
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
55+
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
56+
readinessProbe:
57+
httpGet:
58+
path: /readyz
59+
port: {{ .Values.livenessProbe.port }}
60+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
61+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
62+
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
63+
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
64+
resources:
65+
{{- toYaml .Values.resources | nindent 10 }}
66+
serviceAccountName: {{ include "etcd-operator.serviceAccountName" . }}
67+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This NetworkPolicy allows ingress traffic
2+
# with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods on those
3+
# namespaces are able to gathering data from the metrics endpoint.
4+
apiVersion: networking.k8s.io/v1
5+
kind: NetworkPolicy
6+
metadata:
7+
labels:
8+
{{- include "etcd-operator.labels" . | nindent 4 }}
9+
name: allow-metrics-traffic
10+
namespace: {{ .Release.Namespace }}
11+
spec:
12+
podSelector:
13+
matchLabels:
14+
control-plane: controller-manager
15+
{{- include "etcd-operator.selectorLabels" . | nindent 6 }}
16+
policyTypes:
17+
- Ingress
18+
ingress:
19+
# This allows ingress traffic from any namespace with the label metrics: enabled
20+
- from:
21+
- namespaceSelector:
22+
matchLabels:
23+
metrics: enabled # Only from namespaces with this label
24+
ports:
25+
- port: 8443
26+
protocol: TCP

0 commit comments

Comments
 (0)