Skip to content

Commit

Permalink
Tests for ETCD.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 25, 2023
1 parent 1ded009 commit b522071
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 69 deletions.
149 changes: 81 additions & 68 deletions deploy/etcd-local.yaml
Original file line number Diff line number Diff line change
@@ -1,139 +1,152 @@
# DO NOT EDIT! This is auto-generated by the integration tests
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
creationTimestamp: null
labels:
app: etcd-statefulset
instance: etcd-main
name: etcd
role: main
name: etcd-main
app: etcd
name: etcd
spec:
podManagementPolicy: OrderedReady
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
instance: etcd-main
name: etcd
serviceName: etcd-main-client
app: etcd
serviceName: etcd
template:
metadata:
creationTimestamp: null
labels:
app: etcd-statefulset
instance: etcd-main
name: etcd
role: main
app: etcd
spec:
containers:
- image: quay.io/coreos/etcd:v3.5.7
# can also be gcr.io/etcd-development/etcd
name: etcd
command:
- command:
- backup-restore-sidecar
- wait
imagePullPolicy: IfNotPresent
image: quay.io/coreos/etcd:v3.5.7
livenessProbe:
exec:
command:
- /usr/local/bin/etcdctl
- endpoint
- health
- --endpoints=127.0.0.1:32379
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
name: etcd
ports:
- containerPort: 2380
name: server
protocol: TCP
- containerPort: 2379
- containerPort: 32379
name: client
protocol: TCP
- containerPort: 32380
name: server
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /health
port: 2381
port: 32381
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 900m
memory: 3G
requests:
cpu: 300m
memory: 1G
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
resources: {}
volumeMounts:
- mountPath: /data
name: etcd
- name: bin-provision
name: data
- mountPath: /usr/local/bin/backup-restore-sidecar
name: bin-provision
subPath: backup-restore-sidecar
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
- image: quay.io/coreos/etcd:v3.5.7
name: backup-restore-sidecar
command:
- mountPath: /etc/backup-restore-sidecar
name: backup-restore-sidecar-config
- command:
- backup-restore-sidecar
- start
- --log-level=debug
env: []
image: quay.io/coreos/etcd:v3.5.7
name: backup-restore-sidecar
ports:
- containerPort: 8000
name: grpc
resources: {}
volumeMounts:
- name: etcd
mountPath: /data
- name: bin-provision
- mountPath: /backup
name: backup
- mountPath: /data
name: data
- mountPath: /etc/backup-restore-sidecar
name: backup-restore-sidecar-config
- mountPath: /usr/local/bin/backup-restore-sidecar
name: bin-provision
subPath: backup-restore-sidecar
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
initContainers:
- name: backup-restore-sidecar-provider
image: ghcr.io/metal-stack/backup-restore-sidecar:latest
imagePullPolicy: IfNotPresent
command:
- command:
- cp
- /backup-restore-sidecar
- /bin-provision
ports:
- containerPort: 2112
image: ghcr.io/metal-stack/backup-restore-sidecar:latest
imagePullPolicy: IfNotPresent
name: backup-restore-sidecar-provider
resources: {}
volumeMounts:
- name: bin-provision
mountPath: /bin-provision
- mountPath: /bin-provision
name: bin-provision
volumes:
- name: etcd
- name: data
persistentVolumeClaim:
claimName: data
- name: backup
persistentVolumeClaim:
claimName: etcd
- name: backup-restore-sidecar-config
configMap:
name: backup-restore-sidecar-config-etcd
- name: bin-provision
emptyDir: {}
claimName: backup
- configMap:
name: backup-restore-sidecar-config-postgres
name: backup-restore-sidecar-config
- emptyDir: {}
name: bin-provision
updateStrategy: {}
volumeClaimTemplates:
- metadata:
name: etcd
creationTimestamp: null
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
- metadata:
creationTimestamp: null
name: backup
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
status:
availableReplicas: 0
replicas: 0
---
apiVersion: v1
kind: ConfigMap
metadata:
name: backup-restore-sidecar-config-etcd
data:
config.yaml: |
---
bind-addr: 0.0.0.0
db: etcd
db-data-directory: /data/etcd/
backup-provider: local
backup-cron-schedule: "*/1 * * * *"
object-prefix: etcd-test
etcd-endpoints: http://localhost:32379
post-exec-cmds:
- etcd --data-dir=/data/etcd --listen-metrics-urls http://0.0.0.0:2381
- etcd --data-dir=/data/etcd --listen-client-urls http://0.0.0.0:32379 --advertise-client-urls http://0.0.0.0:32379 --listen-peer-urls http://0.0.0.0:32380 --initial-advertise-peer-urls http://0.0.0.0:32380 --initial-cluster default=http://0.0.0.0:32380 --listen-metrics-urls http://0.0.0.0:32381
kind: ConfigMap
metadata:
creationTimestamp: null
name: backup-restore-sidecar-config-postgres
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
go.etcd.io/etcd/client/v3 v3.5.9
go.uber.org/zap v1.25.0
golang.org/x/sync v0.3.0
google.golang.org/api v0.137.0
Expand All @@ -39,6 +40,8 @@ require (
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
Expand Down Expand Up @@ -94,6 +97,8 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
Expand Down
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -128,6 +132,7 @@ github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -380,6 +385,12 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k=
go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Expand Down
Loading

0 comments on commit b522071

Please sign in to comment.