|
| 1 | +<p align="center"> |
| 2 | + <a href="https://artifacthub.io/packages/search?repo=cloudpirates-etcd"><img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/cloudpirates-etcd" /></a> |
| 3 | +</p> |
| 4 | + |
| 5 | +# etcd Helm Chart |
| 6 | + |
| 7 | +etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being simple, secure, fast, and reliable. |
| 8 | + |
| 9 | +## Quick Start |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +- Kubernetes 1.24+ |
| 14 | +- Helm 3.2.0+ |
| 15 | +- PV provisioner support in the underlying infrastructure (if persistence is enabled) |
| 16 | + |
| 17 | +### Installation |
| 18 | + |
| 19 | +To install the chart with the release name `my-etcd`: |
| 20 | + |
| 21 | +```bash |
| 22 | +helm install my-etcd oci://registry-1.docker.io/cloudpirates/etcd |
| 23 | +``` |
| 24 | + |
| 25 | +To install with custom values: |
| 26 | + |
| 27 | +```bash |
| 28 | +helm install my-etcd oci://registry-1.docker.io/cloudpirates/etcd -f my-values.yaml |
| 29 | +``` |
| 30 | + |
| 31 | +Or install directly from the local chart: |
| 32 | + |
| 33 | +```bash |
| 34 | +helm install my-etcd ./charts/etcd |
| 35 | +``` |
| 36 | + |
| 37 | +### Getting Started |
| 38 | + |
| 39 | +1. Check the status of your etcd cluster: |
| 40 | + |
| 41 | +```bash |
| 42 | +kubectl exec -it my-etcd-0 -- etcdctl \ |
| 43 | + --endpoints=my-etcd:2379 \ |
| 44 | + endpoint health |
| 45 | +``` |
| 46 | + |
| 47 | +2. Connect to etcd from inside the cluster: |
| 48 | + |
| 49 | +```bash |
| 50 | +kubectl run etcd-client --rm --tty -i --restart='Never' \ |
| 51 | + --image gcr.io/etcd-development/etcd:v3.6.0-alpha.0 -- bash |
| 52 | + |
| 53 | +# Inside the pod: |
| 54 | +etcdctl --endpoints=my-etcd:2379 endpoint status --write-out=table |
| 55 | +``` |
| 56 | + |
| 57 | +## Configuration |
| 58 | + |
| 59 | +### Image Configuration |
| 60 | + |
| 61 | +| Parameter | Description | Default | |
| 62 | +| ------------------- | ------------------------------------- | ------------------------------------ | |
| 63 | +| `image.registry` | etcd image registry | `gcr.io` | |
| 64 | +| `image.repository` | etcd image repository | `etcd-development/etcd` | |
| 65 | +| `image.tag` | etcd image tag | `v3.6.0-alpha.0` | |
| 66 | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | |
| 67 | +| `global.imageRegistry` | Global Docker image registry override | `""` | |
| 68 | +| `global.imagePullSecrets` | Global Docker registry secret names | `[]` | |
| 69 | + |
| 70 | +### Common Parameters |
| 71 | + |
| 72 | +| Parameter | Description | Default | |
| 73 | +| ------------------- | --------------------------------------- | ------- | |
| 74 | +| `nameOverride` | String to partially override etcd.fullname | `""` | |
| 75 | +| `fullnameOverride` | String to fully override etcd.fullname | `""` | |
| 76 | +| `commonLabels` | Labels to add to all deployed objects | `{}` | |
| 77 | +| `commonAnnotations` | Annotations to add to all deployed objects | `{}` | |
| 78 | +| `replicaCount` | Number of etcd replicas to deploy (must be odd) | `3` | |
| 79 | +| `podLabels` | Additional labels for etcd pods | `{}` | |
| 80 | +| `podAnnotations` | Additional annotations for etcd pods | `{}` | |
| 81 | + |
| 82 | +### Service Configuration |
| 83 | + |
| 84 | +| Parameter | Description | Default | |
| 85 | +| ---------------------- | ----------------------- | ----------- | |
| 86 | +| `service.type` | Kubernetes service type | `ClusterIP` | |
| 87 | +| `service.annotations` | Service annotations | `{}` | |
| 88 | +| `service.clientPort` | etcd client port | `2379` | |
| 89 | +| `service.peerPort` | etcd peer port | `2380` | |
| 90 | +| `service.metricsPort` | etcd metrics port | `2381` | |
| 91 | + |
| 92 | +### Authentication and Security |
| 93 | + |
| 94 | +| Parameter | Description | Default | |
| 95 | +| --------------------------- | -------------------------------------------------- | ------- | |
| 96 | +| `auth.enabled` | Enable client-to-server TLS authentication | `false` | |
| 97 | +| `auth.existingSecret` | Name of existing secret containing client certificates | `""` | |
| 98 | +| `auth.peer.enabled` | Enable peer-to-peer TLS authentication | `false` | |
| 99 | +| `auth.peer.existingSecret` | Name of existing secret containing peer certificates | `""` | |
| 100 | + |
| 101 | +### etcd Configuration |
| 102 | + |
| 103 | +| Parameter | Description | Default | |
| 104 | +| -------------------------------- | -------------------------------------------- | --------------- | |
| 105 | +| `config.initialClusterState` | Initial cluster state (new or existing) | `new` | |
| 106 | +| `config.autoCompactionMode` | Auto compaction mode (periodic or revision) | `periodic` | |
| 107 | +| `config.autoCompactionRetention` | Auto compaction retention | `1` | |
| 108 | +| `config.snapshotCount` | Number of transactions to trigger a snapshot | `10000` | |
| 109 | +| `config.quotaBackendBytes` | Backend storage quota in bytes (2GB) | `2147483648` | |
| 110 | +| `config.maxRequestBytes` | Maximum client request size in bytes | `1572864` | |
| 111 | +| `config.logLevel` | Log level (debug, info, warn, error, panic, fatal) | `info` | |
| 112 | +| `config.initialClusterToken` | Initial cluster token | `etcd-cluster` | |
| 113 | +| `config.heartbeatInterval` | Heartbeat interval in milliseconds | `100` | |
| 114 | +| `config.electionTimeout` | Election timeout in milliseconds | `1000` | |
| 115 | +| `config.maxSnapshots` | Maximum number of snapshot files to retain | `5` | |
| 116 | +| `config.maxWals` | Maximum number of WAL files to retain | `5` | |
| 117 | +| `config.listenPeerIp` | IP address to bind for peer traffic | `0.0.0.0` | |
| 118 | +| `config.listenClientIp` | IP address to bind for client traffic | `0.0.0.0` | |
| 119 | + |
| 120 | +### Persistence |
| 121 | + |
| 122 | +| Parameter | Description | Default | |
| 123 | +| ----------------------------- | ---------------------------------------- | ---------------- | |
| 124 | +| `persistence.enabled` | Enable persistence using PVC | `true` | |
| 125 | +| `persistence.storageClass` | Storage class of backing PVC | `""` | |
| 126 | +| `persistence.annotations` | Annotations for the PVC | `{}` | |
| 127 | +| `persistence.size` | Size of data volume | `8Gi` | |
| 128 | +| `persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]`| |
| 129 | +| `persistence.mountPath` | Mount path for data volume | `/var/run/etcd` | |
| 130 | + |
| 131 | +### Resources |
| 132 | + |
| 133 | +| Parameter | Description | Default | |
| 134 | +| ----------- | ------------------------------------ | ------- | |
| 135 | +| `resources` | CPU/Memory resource requests/limits | `{}` | |
| 136 | + |
| 137 | +### StatefulSet Configuration |
| 138 | + |
| 139 | +| Parameter | Description | Default | |
| 140 | +| ------------------ | ------------------------------ | ----------------- | |
| 141 | +| `updateStrategy.type` | StatefulSet update strategy | `RollingUpdate` | |
| 142 | + |
| 143 | +### Metrics Configuration |
| 144 | + |
| 145 | +| Parameter | Description | Default | |
| 146 | +| -------------------------------------------- | ------------------------------------------------ | ------- | |
| 147 | +| `metrics.enabled` | Enable Prometheus metrics | `true` | |
| 148 | +| `metrics.serviceMonitor.enabled` | Create ServiceMonitor for Prometheus Operator | `false` | |
| 149 | +| `metrics.serviceMonitor.namespace` | Namespace for ServiceMonitor | `""` | |
| 150 | +| `metrics.serviceMonitor.interval` | Scrape interval | `30s` | |
| 151 | +| `metrics.serviceMonitor.scrapeTimeout` | Scrape timeout | `""` | |
| 152 | +| `metrics.serviceMonitor.relabelings` | Relabel configurations | `[]` | |
| 153 | +| `metrics.serviceMonitor.metricRelabelings` | Metric relabel configurations | `[]` | |
| 154 | +| `metrics.serviceMonitor.labels` | Additional labels for ServiceMonitor | `{}` | |
| 155 | +| `metrics.serviceMonitor.honorLabels` | Honor labels from metrics | `false` | |
| 156 | + |
| 157 | +### High Availability |
| 158 | + |
| 159 | +| Parameter | Description | Default | |
| 160 | +| ----------------------------------- | ------------------------------------- | ------- | |
| 161 | +| `podDisruptionBudget.enabled` | Enable PodDisruptionBudget | `false` | |
| 162 | +| `podDisruptionBudget.minAvailable` | Minimum number of available pods | `""` | |
| 163 | +| `podDisruptionBudget.maxUnavailable`| Maximum number of unavailable pods | `1` | |
| 164 | + |
| 165 | +### Service Account |
| 166 | + |
| 167 | +| Parameter | Description | Default | |
| 168 | +| -------------------------------------------- | ---------------------------------------- | ------- | |
| 169 | +| `serviceAccount.create` | Create service account | `true` | |
| 170 | +| `serviceAccount.name` | Service account name | `""` | |
| 171 | +| `serviceAccount.annotations` | Service account annotations | `{}` | |
| 172 | +| `serviceAccount.automountServiceAccountToken`| Automount service account token | `false` | |
| 173 | + |
| 174 | +### Network Policy |
| 175 | + |
| 176 | +| Parameter | Description | Default | |
| 177 | +| -------------------------------- | ------------------------------------ | ------- | |
| 178 | +| `networkPolicy.enabled` | Enable NetworkPolicy | `false` | |
| 179 | +| `networkPolicy.allowExternal` | Allow external traffic | `true` | |
| 180 | +| `networkPolicy.extraIngress` | Additional ingress rules | `[]` | |
| 181 | +| `networkPolicy.extraEgress` | Additional egress rules | `[]` | |
| 182 | + |
| 183 | +### Security Context |
| 184 | + |
| 185 | +| Parameter | Description | Default | |
| 186 | +| -------------------------------------------- | -------------------------------------------- | ------------------ | |
| 187 | +| `containerSecurityContext.runAsUser` | User ID to run the container | `1000` | |
| 188 | +| `containerSecurityContext.runAsGroup` | Group ID to run the container | `1000` | |
| 189 | +| `containerSecurityContext.runAsNonRoot` | Run as non-root user | `true` | |
| 190 | +| `containerSecurityContext.allowPrivilegeEscalation` | Allow privilege escalation | `false` | |
| 191 | +| `containerSecurityContext.readOnlyRootFilesystem` | Mount root filesystem as read-only | `true` | |
| 192 | +| `containerSecurityContext.capabilities.drop` | Linux capabilities to drop | `[ALL]` | |
| 193 | +| `podSecurityContext.fsGroup` | Group ID for the volumes | `1000` | |
| 194 | + |
| 195 | +### Probes |
| 196 | + |
| 197 | +| Parameter | Description | Default | |
| 198 | +| ----------------------------------- | ---------------------------------- | ------- | |
| 199 | +| `startupProbe.enabled` | Enable startup probe | `true` | |
| 200 | +| `startupProbe.initialDelaySeconds` | Initial delay for startup probe | `0` | |
| 201 | +| `startupProbe.periodSeconds` | Period for startup probe | `10` | |
| 202 | +| `startupProbe.timeoutSeconds` | Timeout for startup probe | `5` | |
| 203 | +| `startupProbe.failureThreshold` | Failure threshold for startup probe| `30` | |
| 204 | +| `livenessProbe.enabled` | Enable liveness probe | `true` | |
| 205 | +| `livenessProbe.initialDelaySeconds` | Initial delay for liveness probe | `10` | |
| 206 | +| `livenessProbe.periodSeconds` | Period for liveness probe | `10` | |
| 207 | +| `livenessProbe.timeoutSeconds` | Timeout for liveness probe | `5` | |
| 208 | +| `livenessProbe.failureThreshold` | Failure threshold for liveness probe | `3` | |
| 209 | +| `readinessProbe.enabled` | Enable readiness probe | `true` | |
| 210 | +| `readinessProbe.initialDelaySeconds`| Initial delay for readiness probe | `5` | |
| 211 | +| `readinessProbe.periodSeconds` | Period for readiness probe | `10` | |
| 212 | +| `readinessProbe.timeoutSeconds` | Timeout for readiness probe | `5` | |
| 213 | +| `readinessProbe.failureThreshold` | Failure threshold for readiness probe | `3` | |
| 214 | + |
| 215 | +### Scheduling |
| 216 | + |
| 217 | +| Parameter | Description | Default | |
| 218 | +| ------------------------------ | --------------------------------------- | ------- | |
| 219 | +| `nodeSelector` | Node labels for pod assignment | `{}` | |
| 220 | +| `tolerations` | Tolerations for pod assignment | `[]` | |
| 221 | +| `affinity` | Affinity rules for pod assignment | `{}` | |
| 222 | +| `topologySpreadConstraints` | Topology Spread Constraints | `[]` | |
| 223 | +| `priorityClassName` | Priority class name for pod eviction | `""` | |
| 224 | + |
| 225 | +### Extra Configuration |
| 226 | + |
| 227 | +| Parameter | Description | Default | |
| 228 | +| ------------------- | ------------------------------------------------- | ------- | |
| 229 | +| `extraArgs` | Additional etcd command line arguments | `[]` | |
| 230 | +| `extraEnv` | Additional environment variables | `[]` | |
| 231 | +| `extraVolumes` | Additional volumes to add to the pod | `[]` | |
| 232 | +| `extraVolumeMounts` | Additional volume mounts for etcd container | `[]` | |
| 233 | +| `extraObjects` | Array of extra objects to deploy with the release | `[]` | |
| 234 | + |
| 235 | +## Upgrading |
| 236 | + |
| 237 | +To upgrade your release: |
| 238 | + |
| 239 | +```bash |
| 240 | +helm upgrade my-etcd oci://registry-1.docker.io/cloudpirates/etcd |
| 241 | +``` |
| 242 | + |
| 243 | +## Uninstalling |
| 244 | + |
| 245 | +To uninstall/delete the `my-etcd` deployment: |
| 246 | + |
| 247 | +```bash |
| 248 | +helm delete my-etcd |
| 249 | +``` |
| 250 | + |
| 251 | +## License |
| 252 | + |
| 253 | +Copyright © 2024 CloudPirates GmbH & Co. KG |
| 254 | + |
| 255 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 256 | +you may not use this file except in compliance with the License. |
| 257 | +You may obtain a copy of the License at |
| 258 | + |
| 259 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 260 | + |
| 261 | +Unless required by applicable law or agreed to in writing, software |
| 262 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 263 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 264 | +See the License for the specific language governing permissions and |
| 265 | +limitations under the License. |
0 commit comments