forked from gardener/etcd-druid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skaffold.yaml
178 lines (178 loc) · 5.75 KB
/
skaffold.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
apiVersion: skaffold/v4beta10
kind: Config
metadata:
name: etcd-druid
build:
local: { }
artifacts:
- image: europe-docker.pkg.dev/gardener-project/public/gardener/etcd-druid
ko:
fromImage: gcr.io/distroless/static-debian11:nonroot
dependencies:
paths:
- api
- internal
- go.mod
- VERSION
flags:
- -v
ldflags:
- -X github.com/gardener/etcd-druid/internal/version.Version={{.VERSION}}
- -X github.com/gardener/etcd-druid/internal/version.GitSHA={{.GIT_SHA}}
deploy:
helm:
releases:
- name: etcd-druid
chartPath: charts/druid
namespace: default
skipBuildDependencies: true
setValues: # empty `setValues` value is not allowed
foo: bar
profiles:
# Profile to disable druid leader election, to allow debugging without abrupt exits due to failure to renew leader election lease within time.
- name: debug
patches:
- op: add
path: /deploy/helm/releases/0/setValues/replicas
value: 1
- op: add
path: /deploy/helm/releases/0/setValues/controllerManager
value:
leaderElection:
enabled: false
- name: e2e-test
activation:
- env: "DRUID_E2E_TEST=true"
patches:
- op: add
path: /deploy/helm/releases/0/setValues/controllers
value:
etcd:
etcdStatusSyncPeriod: 5s
compaction:
etcdEventsThreshold: 15
metricsScrapeWaitDuration: 30s
- name: enable-etcdcomponents-webhook
activation:
- env: "DRUID_ENABLE_ETCD_COMPONENTS_WEBHOOK=true"
patches:
- op: add
path: /deploy/helm/releases/0/setValues/webhooks
value:
etcdcomponents:
enabled: true
- name: do-not-use-feature-gates
activation:
- env: "USE_ETCD_DRUID_FEATURE_GATES=false"
patches:
- op: add
path: /deploy/helm/releases/0/setValues/featureGates
value:
UseEtcdWrapper: false
---
apiVersion: skaffold/v4beta10
kind: Config
metadata:
name: druid-e2e
deploy:
kubectl:
hooks:
before:
- host:
command:
- sh
- -c
- |
echo "Deleting previous job"
namespace_flag=${SKAFFOLD_NAMESPACES:-""}
if [ -n "$namespace_flag" ]; then
namespace_flag="-n ${namespace_flag}"
fi
kubectl delete job -l role=infra-job --ignore-not-found=true $namespace_flag
after:
- host:
command:
- sh
- -c
- |
echo "Wait until job is ready"
namespace_flag=${SKAFFOLD_NAMESPACES:-""}
if [ -n "$namespace_flag" ]; then
namespace_flag="-n ${namespace_flag}"
fi
kubectl wait --for=condition=Complete job -l role=infra-job --timeout=5m $namespace_flag
os: [ darwin, linux ]
manifests:
kustomize: { }
profiles:
# Profile to create the required S3 backup bucket for an e2e test.
- name: aws-setup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/aws/setup ]
# Profile to delete the S3 backup bucket from an e2e test.
- name: aws-cleanup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/aws/cleanup ]
# Profile to create the required Azure storage container for an e2e test.
- name: azure-setup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/azure/setup ]
# Profile to delete the Azure storage container from an e2e test.
- name: azure-cleanup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/azure/cleanup ]
# Profile to create the required GCP backup bucket for an e2e test.
- name: gcp-setup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/gcp/setup ]
- op: add
path: /manifests/kustomize/hooks/before/-
value: {
"host": {
"command": [ sh, -c, '
echo "Copying GCP service account json" &&
touch "hack/e2e-test/infrastructure/overlays/gcp/common/assets/serviceaccount.json" &&
cp "$GCP_SERVICEACCOUNT_JSON_PATH" "hack/e2e-test/infrastructure/overlays/gcp/common/assets/serviceaccount.json"' ],
"os": [ darwin, linux ]
}
}
# Profile to delete the GCP backup bucket from an e2e test.
- name: gcp-cleanup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/gcp/cleanup ]
- op: add
path: /manifests/kustomize/hooks/before/-
value: {
"host": {
"command": [ sh, -c, '
echo "Copying GCP service account json" &&
touch "hack/e2e-test/infrastructure/overlays/gcp/common/assets/serviceaccount.json" &&
cp "$GCP_SERVICEACCOUNT_JSON_PATH" "hack/e2e-test/infrastructure/overlays/gcp/common/assets/serviceaccount.json"' ],
"os": [ darwin, linux ]
}
}
# Profile to create the required Local storage container for an e2e test.
- name: local-setup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/local/setup ]
# Profile to delete the Local storage container from an e2e test.
- name: local-cleanup
patches:
- op: add
path: /manifests/kustomize/paths
value: [ hack/e2e-test/infrastructure/overlays/local/cleanup ]