Skip to content

Commit 043eb1e

Browse files
committed
Update make deploy target
Adds the '--server-side' and '--force-conflicts' flags to the 'deploy' Make target to correct for CRD size limits and potential errors when re-applying.
1 parent 43af00c commit 043eb1e

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Makefile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,17 @@ createnamespaces:
8383
deletenamespaces:
8484
$(PGO_KUBE_CLIENT) delete -k ./config/namespace
8585

86-
# Install the postgrescluster CRD
87-
# Note: using `--server-side --force-conflicts` when applying the K8s objects in order to
86+
# Note: For 'install', 'deploy' and 'deploy-dev' below
87+
# Using `--server-side --force-conflicts` when applying the K8s objects in order to
8888
# A) remove the `kubectl.kubernetes.io/last-applied-configuration` from the CRD since it
8989
# was violating the limit on size of `metadata.annotations`
9090
# - https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go#L36
9191
# B) overriding conflicts around managed fields during subsequent applies;
9292
# the fields that were erroring in a local k3s cluster were `.status.conditions`,
9393
# `.status.acceptedNames.kind`, and `.status.acceptedNames.plural`, which were managed by
9494
# `k3s` rather than by `kubectl`
95+
96+
# Install the postgrescluster CRD
9597
install:
9698
$(PGO_KUBE_CLIENT) apply --server-side --force-conflicts -k ./config/crd
9799

@@ -101,17 +103,9 @@ uninstall:
101103

102104
# Deploy the PostgreSQL Operator (enables the postgrescluster controller)
103105
deploy:
104-
$(PGO_KUBE_CLIENT) apply -k ./config/default
106+
$(PGO_KUBE_CLIENT) apply --server-side --force-conflicts -k ./config/default
105107

106108
# Deploy the PostgreSQL Operator locally
107-
# Note: using `--server-side --force-conflicts` when applying the K8s objects in order to
108-
# A) remove the `kubectl.kubernetes.io/last-applied-configuration` from the CRD since it
109-
# was violating the limit on size of `metadata.annotations`
110-
# - https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go#L36
111-
# B) overriding conflicts around managed fields during subsequent applies;
112-
# the fields that were erroring in a local k3s cluster were `.status.conditions`,
113-
# `.status.acceptedNames.kind`, and `.status.acceptedNames.plural`, which were managed by
114-
# `k3s` rather than by `kubectl`
115109
deploy-dev: build-postgres-operator createnamespaces
116110
$(PGO_KUBE_CLIENT) apply --server-side --force-conflicts -k ./config/dev
117111
hack/create-kubeconfig.sh postgres-operator pgo

0 commit comments

Comments
 (0)