Skip to content

Commit

Permalink
feat: upgrade Kustomize to v5.0.1 (argoproj#12299)
Browse files Browse the repository at this point in the history
* feat: upgrade Kustomize to v5.0.0 and Helm to v3.11.0

Signed-off-by: Michael Crenshaw <[email protected]>

* fix helm3 ref

Signed-off-by: Michael Crenshaw <[email protected]>

* fix duplicate key

Signed-off-by: Michael Crenshaw <[email protected]>

* 3.11.1

Signed-off-by: Michael Crenshaw <[email protected]>

* codegen

Signed-off-by: Michael Crenshaw <[email protected]>

* fix test

Signed-off-by: Michael Crenshaw <[email protected]>

* 5.0.1

Signed-off-by: Michael Crenshaw <[email protected]>

* upgrade note

Signed-off-by: Michael Crenshaw <[email protected]>

---------

Signed-off-by: Michael Crenshaw <[email protected]>
  • Loading branch information
crenshaw-dev authored Mar 16, 2023
1 parent 481ee54 commit 25badeb
Show file tree
Hide file tree
Showing 29 changed files with 71 additions and 53 deletions.
8 changes: 3 additions & 5 deletions docs/operator-manual/declarative-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,15 @@ based application which uses base Argo CD manifests from [https://github.com/arg
Example of `kustomization.yaml`:

```yaml
bases:
- github.com/argoproj/argo-cd//manifests/cluster-install?ref=v1.0.1
# additional resources like ingress rules, cluster and repository secrets.
resources:
- github.com/argoproj/argo-cd//manifests/cluster-install?ref=v1.0.1
- clusters-secrets.yaml
- repos-secrets.yaml
# changes to config maps
patchesStrategicMerge:
- overlays/argo-cd-cm.yaml
patches:
- path: overlays/argo-cd-cm.yaml
```

The live example of self managed Argo CD config is available at [https://cd.apps.argoproj.io](https://cd.apps.argoproj.io) and with configuration
Expand Down
11 changes: 7 additions & 4 deletions docs/operator-manual/upgrading/2.6-2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ p, role:org-admin, extensions, invoke, my-proj/*, allow

Note that bundled Helm version has been upgraded from 3.10.3 to 3.11.2.

[1]: ../../developer-guide/extensions/proxy-extensions.md
[2]: https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#the-extensions-resource
## Upgraded Kustomize Version

Note that bundled Kustomize version has been upgraded from 4.5.7 to 5.0.1.

## Notifications: `^` behavior change in Sprig's semver functions
Argo CD 2.7 upgrades Sprig templating specifically within Argo CD notifications to v3. That upgrade includes an upgrade of [Masterminds/semver](https://github.com/Masterminds/semver/releases) to v3.
Expand All @@ -48,6 +49,8 @@ Masterminds/semver v3 changed the behavior of the `^` prefix in semantic version

## Tini as entrypoint

The manifests are now using [`tini` as entrypoint][1], instead of `entrypoint.sh`. Until 2.8, `entrypoint.sh` is retained for upgrade compatibility. This means that the deployment manifests have to be updated after upgrading to 2.7, and before upgrading to 2.8 later. In case the manifests are updated before moving to 2.8, the containers will not be able to start.
The manifests are now using [`tini` as entrypoint][3], instead of `entrypoint.sh`. Until 2.8, `entrypoint.sh` is retained for upgrade compatibility. This means that the deployment manifests have to be updated after upgrading to 2.7, and before upgrading to 2.8 later. In case the manifests are updated before moving to 2.8, the containers will not be able to start.

[1]: https://github.com/argoproj/argo-cd/pull/12707
[1]: ../../developer-guide/extensions/proxy-extensions.md
[2]: https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#the-extensions-resource
[3]: https://github.com/argoproj/argo-cd/pull/12707
2 changes: 1 addition & 1 deletion docs/user-guide/best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ repository or kustomize base.
For example, consider the following kustomization.yaml

```yaml
bases:
resources:
- github.com/argoproj/argo-cd//manifests/cluster-install
```
Expand Down
10 changes: 4 additions & 6 deletions examples/known-hosts/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- github.com/argoproj/argo-cd//manifests/cluster-install?ref=stable

patchesStrategicMerge:
- argocd-known-hosts-mounts.yaml

resources:
- github.com/argoproj/argo-cd//manifests/cluster-install?ref=stable
- argocd-known-hosts.yaml

patches:
- path: argocd-known-hosts-mounts.yaml
6 changes: 3 additions & 3 deletions examples/plugins/helm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bases:
resources:
- ../../../manifests/base

configMapGenerator:
Expand All @@ -11,5 +11,5 @@ configMapGenerator:
generatorOptions:
disableNameSuffixHash: true

patchesStrategicMerge:
- argocd-repo-server-deployment-patch.yaml
patches:
- path: argocd-repo-server-deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4a2b9f7fad0355c8bea08da6dd9c48e790df5f357983280998d80b8dc7ad3def kustomize_5.0.1_darwin_amd64.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b264fe931e85d8ca7c7ac47872695b1fa39fe2b73cfc0d58cbdca0bde69d0bc0 kustomize_5.0.1_darwin_arm64.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dca623b36aef84fbdf28f79d02e9b3705ff641424ac1f872d5420dadb12fb78d kustomize_5.0.1_linux_amd64.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c6e036c5c7eee4c15f7544e441ced5cb6cf9eba24a011c25008df5617cd2fb85 kustomize_5.0.1_linux_arm64.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
75df309f1efa92c57ccd15603be4fb6806e5b62f3e882d892ad34a4ee3c293f4 kustomize_5.0.1_linux_ppc64le.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1c67b27bf72a1c5615bd901b1971a88d920da8255038f13af7bb61695b08fda5 kustomize_5.0.1_linux_s390x.tar.gz
2 changes: 1 addition & 1 deletion hack/installers/install-kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INSTALL_PATH="${INSTALL_PATH:-$PROJECT_ROOT/dist}"
PATH="${INSTALL_PATH}:${PATH}"
[ -d $INSTALL_PATH ] || mkdir -p $INSTALL_PATH

KUSTOMIZE_VERSION=${KUSTOMIZE_VERSION:-$kustomize4_version}
KUSTOMIZE_VERSION=${KUSTOMIZE_VERSION:-$kustomize5_version}

if [ -z $INSTALL_OS ]; then
echo "install kustomize error: unsupported operating system"
Expand Down
2 changes: 1 addition & 1 deletion hack/tool-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
helm3_version=3.11.2
kubectl_version=1.17.8
kubectx_version=0.6.3
kustomize4_version=4.5.7
kustomize5_version=5.0.1
protoc_version=3.17.3
3 changes: 3 additions & 0 deletions manifests/base/redis/argocd-redis-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
- ""
- "--appendonly"
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: ""
ports:
- containerPort: 6379
securityContext:
Expand Down
19 changes: 11 additions & 8 deletions manifests/base/redis/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ resources:
- argocd-redis-service.yaml
- argocd-redis-network-policy.yaml

vars:
- name: ARGOCD_REDIS_SERVICE
objref:
kind: Service
name: argocd-redis
apiVersion: v1
fieldref:
fieldpath: metadata.name
replacements:
- source:
kind: Service
name: argocd-redis
version: v1
targets:
- select:
kind: Deployment
name: argocd-redis
fieldPaths:
- spec.template.spec.containers.[name=redis].env.[name=ARGOCD_REDIS_SERVICE].value
5 changes: 4 additions & 1 deletion manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15777,6 +15777,9 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.9-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -15831,7 +15834,7 @@ spec:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis:6379
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
8 changes: 4 additions & 4 deletions manifests/ha/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization


patchesStrategicMerge:
- overlays/argocd-repo-server-deployment.yaml
- overlays/argocd-server-deployment.yaml
- overlays/argocd-application-controller-statefulset.yaml
patches:
- path: overlays/argocd-repo-server-deployment.yaml
- path: overlays/argocd-server-deployment.yaml
- path: overlays/argocd-application-controller-statefulset.yaml


images:
Expand Down
2 changes: 1 addition & 1 deletion manifests/ha/base/redis-ha/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resources:
- argocd-redis-ha-proxy-network-policy.yaml
- argocd-redis-ha-server-network-policy.yaml

patchesJson6902:
patches:
- target:
version: v1
group: ""
Expand Down
5 changes: 4 additions & 1 deletion manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16277,6 +16277,9 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.9-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -16331,7 +16334,7 @@ spec:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis:6379
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
5 changes: 4 additions & 1 deletion manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,9 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.9-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -996,7 +999,7 @@ spec:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis:6379
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/testdata/crashing-guestbook/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- ../guestbook

patches:
- guestbook-deployment.yaml
- path: guestbook-deployment.yaml
4 changes: 1 addition & 3 deletions test/e2e/testdata/hook-custom-health/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../guestbook

resources:
- ../guestbook
- config-map.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- https://localhost:9443/argo-e2e/testdata.git//guestbook

namePrefix: child-
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- https://argocd-e2e-server:9443/argo-e2e/testdata.git//guestbook

namePrefix: child-
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- ssh://root@localhost:2222/tmp/argo-e2e/testdata.git//config-map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- ssh://root@argocd-e2e-server:2222/tmp/argo-e2e/testdata.git//config-map
6 changes: 3 additions & 3 deletions test/manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
resources:
- ../../../manifests/crds
- ../../../manifests/base/config
- ../../../manifests/cluster-rbac
- ../../../manifests/base/notification

patchesStrategicMerge:
- patches.yaml
patches:
- path: patches.yaml
6 changes: 3 additions & 3 deletions test/manifests/cmp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ resources:
- plugin.yaml
- app.yaml

patchesStrategicMerge:
- repo-patch.yaml
- secret-patch.yaml
patches:
- path: repo-patch.yaml
- path: secret-patch.yaml

images:
- name: quay.io/argoproj/argocd
Expand Down
2 changes: 1 addition & 1 deletion test/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestKustomizeVersion(t *testing.T) {
test.CIOnly(t)
out, err := argoexec.RunCommand("kustomize", argoexec.CmdOpts{}, "version")
assert.NoError(t, err)
assert.Contains(t, out, "Version:kustomize/v4", "kustomize should be version 4")
assert.Contains(t, out, "v5.", "kustomize should be version 5")
}

// TestBuildManifests makes sure we are consistent in naming, and all kustomization.yamls are buildable
Expand Down

0 comments on commit 25badeb

Please sign in to comment.