Skip to content

Commit

Permalink
TEMP switch to server-side apply
Browse files Browse the repository at this point in the history
This is a workaround for the following issue:
kubernetes-sigs/kubebuilder#1140
  • Loading branch information
adutra committed Nov 12, 2021
1 parent 37c8fa9 commit 621be55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,21 @@ kind-load-image:
kind-e2e-test: multi-up e2e-test

single-up: cleanup build manifests kustomize docker-build create-kind-cluster kind-load-image cert-manager
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply --server-side --force-conflicts -f -

single-reload: build manifests kustomize docker-build kind-load-image cert-manager
kubectl config use-context kind-k8ssandra-0
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply --server-side --force-conflicts -f -
kubectl delete pod -l control-plane=k8ssandra-operator
kubectl rollout status deployment k8ssandra-operator

multi-up: cleanup build manifests kustomize docker-build create-kind-multicluster kind-load-image-multi cert-manager-multi
## install the control plane
kubectl config use-context kind-k8ssandra-0
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply --server-side --force-conflicts -f -
## install the data plane
kubectl config use-context kind-k8ssandra-1
$(KUSTOMIZE) build config/deployments/data-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/data-plane | kubectl apply --server-side --force-conflicts -f -
## Create a client config
make create-client-config
## Restart the control plane
Expand All @@ -172,12 +172,12 @@ multi-up: cleanup build manifests kustomize docker-build create-kind-multicluste
multi-reload: build manifests kustomize docker-build kind-load-image-multi cert-manager-multi
# Reload the operator on the control-plane
kubectl config use-context kind-k8ssandra-0
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply --server-side --force-conflicts -f -
kubectl -n $(NS) delete pod -l control-plane=k8ssandra-operator
kubectl -n $(NS) rollout status deployment k8ssandra-operator
# Reload the operator on the data-plane
kubectl config use-context kind-k8ssandra-1
$(KUSTOMIZE) build config/deployments/data-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/data-plane | kubectl apply --server-side --force-conflicts -f -
kubectl -n $(NS) delete pod -l control-plane=k8ssandra-operator
kubectl -n $(NS) rollout status deployment k8ssandra-operator

Expand Down Expand Up @@ -206,14 +206,14 @@ kind-load-image-multi:
##@ Deployment

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
$(KUSTOMIZE) build config/crd | kubectl apply --server-side --force-conflicts -f -

uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply -f -
$(KUSTOMIZE) build config/deployments/control-plane | kubectl apply --server-side --force-conflicts -f -

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/deployments/control-plane | kubectl delete -f -
Expand Down
2 changes: 1 addition & 1 deletion test/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Apply(opts Options, arg interface{}) error {
cmd.Args = append(cmd.Args, "-n", opts.Namespace)
}

cmd.Args = append(cmd.Args, "apply", "-f")
cmd.Args = append(cmd.Args, "apply", "--server-side", "--force-conflicts", "-f")

if buf, ok := arg.(*bytes.Buffer); ok {
cmd.Stdin = buf
Expand Down

0 comments on commit 621be55

Please sign in to comment.