Skip to content

Commit

Permalink
Add etcd-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <[email protected]>
  • Loading branch information
kvaps committed Apr 24, 2024
1 parent a956713 commit a6d0f7c
Show file tree
Hide file tree
Showing 36 changed files with 2,269 additions and 21 deletions.
6 changes: 6 additions & 0 deletions packages/core/platform/bundles/distro-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ releases:
privileged: true
dependsOn: [cilium]

- name: etcd-operator
releaseName: etcd-operator
chart: cozy-etcd-operator
namespace: cozy-etcd-operator
dependsOn: [cilium,cert-manager]

- name: grafana-operator
releaseName: grafana-operator
chart: cozy-grafana-operator
Expand Down
6 changes: 6 additions & 0 deletions packages/core/platform/bundles/distro-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ releases:
privileged: true
dependsOn: [victoria-metrics-operator]

- name: etcd-operator
releaseName: etcd-operator
chart: cozy-etcd-operator
namespace: cozy-etcd-operator
dependsOn: [cert-manager]

- name: grafana-operator
releaseName: grafana-operator
chart: cozy-grafana-operator
Expand Down
6 changes: 6 additions & 0 deletions packages/core/platform/bundles/paas-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ releases:
privileged: true
dependsOn: [cilium,kubeovn]

- name: etcd-operator
releaseName: etcd-operator
chart: cozy-etcd-operator
namespace: cozy-etcd-operator
dependsOn: [cilium,kubeovn,cert-manager]

- name: grafana-operator
releaseName: grafana-operator
chart: cozy-grafana-operator
Expand Down
6 changes: 6 additions & 0 deletions packages/core/platform/bundles/paas-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ releases:
privileged: true
dependsOn: [victoria-metrics-operator]

- name: etcd-operator
releaseName: etcd-operator
chart: cozy-etcd-operator
namespace: cozy-etcd-operator
dependsOn: [cert-manager]

- name: grafana-operator
releaseName: grafana-operator
chart: cozy-grafana-operator
Expand Down
2 changes: 2 additions & 0 deletions packages/core/platform/templates/helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ spec:
interval: 1m
releaseName: {{ $x.releaseName | default $x.name }}
install:
crds: CreateReplace
remediation:
retries: -1
upgrade:
crds: CreateReplace
remediation:
retries: -1
chart:
Expand Down
2 changes: 1 addition & 1 deletion packages/extra/etcd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: etcd
description: Storage for Kubernetes clusters
icon: https://www.svgrepo.com/show/353714/etcd.svg
type: application
version: 1.0.0
version: 2.0.0
36 changes: 36 additions & 0 deletions packages/extra/etcd/templates/datastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
apiVersion: kamaji.clastix.io/v1alpha1
kind: DataStore
metadata:
name: {{ .Release.Namespace }}
annotations:
helm.sh/hook: post-install,post-upgrade
spec:
driver: etcd
endpoints:
- etcd-0.etcd-headless.{{ .Release.Namespace }}.svc:2379
- etcd-1.etcd-headless.{{ .Release.Namespace }}.svc:2379
- etcd-2.etcd-headless.{{ .Release.Namespace }}.svc:2379
tlsConfig:
certificateAuthority:
certificate:
secretReference:
keyPath: tls.crt
name: etcd-ca-tls
namespace: {{ .Release.Namespace }}
privateKey:
secretReference:
keyPath: tls.key
name: etcd-ca-tls
namespace: {{ .Release.Namespace }}
clientCertificate:
certificate:
secretReference:
keyPath: tls.crt
name: etcd-client-tls
namespace: {{ .Release.Namespace }}
privateKey:
secretReference:
keyPath: tls.key
name: etcd-client-tls
namespace: {{ .Release.Namespace }}
167 changes: 167 additions & 0 deletions packages/extra/etcd/templates/etcd-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
name: etcd
spec:
storage: {}
security:
tls:
peerTrustedCASecret: etcd-peer-ca-tls
peerSecret: etcd-peer-tls
serverSecret: etcd-server-tls
clientTrustedCASecret: etcd-ca-tls
clientSecret: etcd-client-tls
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: etcd-selfsigning-issuer
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: etcd-peer-ca
spec:
isCA: true
usages:
- "signing"
- "key encipherment"
- "cert sign"
commonName: etcd-peer-ca
subject:
organizations:
- ACME Inc.
organizationalUnits:
- Widgets
secretName: etcd-peer-ca-tls
privateKey:
algorithm: RSA
size: 4096
issuerRef:
name: etcd-selfsigning-issuer
kind: Issuer
group: cert-manager.io
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: etcd-ca
spec:
isCA: true
usages:
- "signing"
- "key encipherment"
- "cert sign"
commonName: etcd-ca
subject:
organizations:
- ACME Inc.
organizationalUnits:
- Widgets
secretName: etcd-ca-tls
privateKey:
algorithm: RSA
size: 4096
issuerRef:
name: etcd-selfsigning-issuer
kind: Issuer
group: cert-manager.io
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: etcd-peer-issuer
spec:
ca:
secretName: etcd-peer-ca-tls
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: etcd-issuer
spec:
ca:
secretName: etcd-ca-tls
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: etcd-server
spec:
secretName: etcd-server-tls
isCA: false
usages:
- "server auth"
- "signing"
- "key encipherment"
dnsNames:
- etcd-0
- etcd-0.etcd-headless
- etcd-0.etcd-headless.{{ .Release.Namespace }}.svc
- etcd-1
- etcd-1.etcd-headless
- etcd-1.etcd-headless.{{ .Release.Namespace }}.svc
- etcd-2
- etcd-2.etcd-headless
- etcd-2.etcd-headless.{{ .Release.Namespace }}.svc
- localhost
- "127.0.0.1"
privateKey:
rotationPolicy: Always
algorithm: RSA
size: 4096
issuerRef:
name: etcd-issuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: etcd-peer
spec:
secretName: etcd-peer-tls
isCA: false
usages:
- "server auth"
- "client auth"
- "signing"
- "key encipherment"
dnsNames:
- etcd-0
- etcd-0.etcd-headless
- etcd-0.etcd-headless.{{ .Release.Namespace }}.svc
- etcd-1
- etcd-1.etcd-headless
- etcd-1.etcd-headless.{{ .Release.Namespace }}.svc
- etcd-2
- etcd-2.etcd-headless
- etcd-2.etcd-headless.{{ .Release.Namespace }}.svc
- localhost
- "127.0.0.1"
privateKey:
rotationPolicy: Always
algorithm: RSA
size: 4096
issuerRef:
name: etcd-peer-issuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: etcd-client
spec:
commonName: root
secretName: etcd-client-tls
usages:
- "signing"
- "key encipherment"
- "client auth"
privateKey:
rotationPolicy: Always
algorithm: RSA
size: 4096
issuerRef:
name: etcd-issuer
kind: Issuer
19 changes: 0 additions & 19 deletions packages/extra/etcd/templates/kamaji-etcd.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion packages/extra/versions_map
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
etcd 1.0.0 HEAD
etcd 1.0.0 f7eaab0
etcd 2.0.0 HEAD
ingress 1.0.0 HEAD
monitoring 1.0.0 HEAD
3 changes: 3 additions & 0 deletions packages/system/etcd-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
images
hack
.gitkeep
2 changes: 2 additions & 0 deletions packages/system/etcd-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: cozy-etcd-operator
version: 0.4.0
8 changes: 8 additions & 0 deletions packages/system/etcd-operator/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NAME=etcd-operator
NAMESPACE=cozy-etcd-operator

include ../../../scripts/package-system.mk

update:
rm -rf charts
helm pull oci://ghcr.io/aenix-io/charts/etcd-operator --untar --untardir charts
23 changes: 23 additions & 0 deletions packages/system/etcd-operator/charts/etcd-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions packages/system/etcd-operator/charts/etcd-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
appVersion: v0.2.0
name: etcd-operator
type: application
version: 0.2.0
Loading

0 comments on commit a6d0f7c

Please sign in to comment.