@@ -126,19 +126,19 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
126
126
KIND_CLUSTER_NAME ?= etcd-operator-kind
127
127
NAMESPACE_NAME ?= etcd-operator-system
128
128
129
- CERT_MANAGER_NAMESPACE ?= cert-manager
129
+ PROMETHEUS_OPERATOR_VERSION ?= v0.72.0
130
130
CERT_MANAGER_VERSION ?= v1.14.4
131
131
132
132
ifndef ignore-not-found
133
133
ignore-not-found = false
134
134
endif
135
135
136
136
.PHONY : install
137
- install : manifests kustomize kind-create # # Install CRDs into the K8s cluster specified in ~/.kube/config
137
+ install : manifests kustomize # # Install CRDs into the K8s cluster specified in ~/.kube/config
138
138
$(KUSTOMIZE ) build config/crd | $(KUBECTL ) apply -f -
139
139
140
140
.PHONY : uninstall
141
- uninstall : manifests kustomize kind-create # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
141
+ uninstall : manifests kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
142
142
$(KUSTOMIZE ) build config/crd | $(KUBECTL ) delete -n $(NAMESPACE_NAME ) --ignore-not-found=$(ignore-not-found ) -f -
143
143
144
144
.PHONY : deploy
@@ -147,14 +147,18 @@ deploy: manifests kustomize kind-load ## Deploy controller to the K8s cluster sp
147
147
$(KUSTOMIZE ) build config/default | $(KUBECTL ) -n $(NAMESPACE_NAME ) apply -f -
148
148
149
149
.PHONY : undeploy
150
- undeploy : kustomize kind-create # # Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
150
+ undeploy : kustomize # # Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
151
151
$(KUSTOMIZE ) build config/default | $(KUBECTL ) delete -n $(NAMESPACE_NAME ) --ignore-not-found=$(ignore-not-found ) -f -
152
152
153
153
.PHONY : redeploy
154
154
redeploy : deploy # # Redeploy controller with new docker image.
155
155
# force recreate pods
156
156
$(KUBECTL ) rollout restart -n $(NAMESPACE_NAME ) deploy/etcd-operator-controller-manager
157
157
158
+ .PHONY : kind-load
159
+ kind-load : docker-build # # Build and upload docker image to the local Kind cluster.
160
+ $(KIND ) load docker-image ${IMG} --name $(KIND_CLUSTER_NAME )
161
+
158
162
.PHONY : kind-create
159
163
kind-create : kind # # Create kubernetes cluster using Kind.
160
164
@if ! $(KIND ) get clusters | grep -q $(KIND_CLUSTER_NAME ) ; then \
@@ -167,19 +171,12 @@ kind-delete: kind ## Create kubernetes cluster using Kind.
167
171
$(KIND ) delete cluster --name $(KIND_CLUSTER_NAME ) ; \
168
172
fi
169
173
170
- .PHONY : kind-load
171
- kind-load : docker-build kind-prepare # # Build and upload docker image to the local Kind cluster.
172
- $(KIND ) load docker-image ${IMG} --name $(KIND_CLUSTER_NAME )
173
-
174
174
.PHONY : kind-prepare
175
- kind-prepare : kind-create # # Prepare kind cluster for installing etcd-operator.
176
- $(HELM ) upgrade \
177
- cert-manager \
178
- https://charts.jetstack.io/charts/cert-manager-$(CERT_MANAGER_VERSION ) .tgz \
179
- --install \
180
- --namespace $(CERT_MANAGER_NAMESPACE ) \
181
- --create-namespace \
182
- --set installCRDs=true
175
+ kind-prepare : kind-create
176
+ # Install prometheus operator
177
+ $(KUBECTL ) apply --server-side -f " https://github.com/prometheus-operator/prometheus-operator/releases/download/$( PROMETHEUS_OPERATOR_VERSION) /bundle.yaml"
178
+ # Install cert-manager operator
179
+ $(KUBECTL ) apply --server-side -f " https://github.com/jetstack/cert-manager/releases/download/$( CERT_MANAGER_VERSION) /cert-manager.yaml"
183
180
184
181
# #@ Dependencies
185
182
@@ -194,19 +191,16 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
194
191
CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
195
192
ENVTEST ?= $(LOCALBIN ) /setup-envtest
196
193
GOLANGCI_LINT = $(LOCALBIN ) /golangci-lint
197
- HELM ?= $(LOCALBIN ) /helm
198
194
KIND ?= $(LOCALBIN ) /kind
199
195
200
196
# # Tool Versions
201
197
KUSTOMIZE_VERSION ?= v5.3.0
202
198
CONTROLLER_TOOLS_VERSION ?= v0.14.0
203
199
ENVTEST_VERSION ?= latest
204
200
GOLANGCI_LINT_VERSION ?= v1.54.2
205
- HELM_VERSION ?= v3.14.3
206
201
KIND_VERSION ?= v0.22.0
207
202
208
203
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
209
- HELM_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3"
210
204
211
205
.PHONY : kustomize
212
206
kustomize : $(LOCALBIN )
@@ -229,13 +223,6 @@ golangci-lint: $(LOCALBIN)
229
223
@test -x $(GOLANGCI_LINT ) && $(GOLANGCI_LINT ) version | grep -q $(GOLANGCI_LINT_VERSION ) || \
230
224
GOBIN=$(LOCALBIN ) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION )
231
225
232
- helm : $(LOCALBIN )
233
- @if test -x $(HELM ) && ! $(HELM ) version | grep -q $(HELM_VERSION ) ; then \
234
- rm -f $(HELM ) ; \
235
- fi
236
- PATH=" $( LOCALBIN) :$( PATH) "
237
- @test -x $(HELM ) || { curl -Ss $( HELM_INSTALL_SCRIPT) | sed " s|/usr/local/bin|$( LOCALBIN) |" | bash -s -- --no-sudo --version $( HELM_VERSION) ; }
238
-
239
226
kind : $(LOCALBIN )
240
227
@test -x $(KIND ) && $(KIND ) version | grep -q $(KIND_VERSION ) || \
241
228
GOBIN=$(LOCALBIN ) go install sigs.k8s.io/kind@$(KIND_VERSION )
0 commit comments