Skip to content

Commit

Permalink
feat: tini as ENTRYPOINT and related cosmetics (argoproj#12707)
Browse files Browse the repository at this point in the history
* Use tini as the ENTRYPOINT implicitly

Signed-off-by: Gergely Czuczy <[email protected]>

* Explicitly call /bin/cp instead of relying on PATH

Signed-off-by: Gergely Czuczy <[email protected]>

* POSIX sh is sufficient for entrypoint.sh

Signed-off-by: Gergely Czuczy <[email protected]>

* Add 2.6-2.7 to docs indexes

Signed-off-by: Gergely Czuczy <[email protected]>

* Add note on tini on entry to 2.6-2.7 upgrade notes

Signed-off-by: Gergely Czuczy <[email protected]>

* Added note to 2.7-2.8 notes on tini as entry

Signed-off-by: Gergely Czuczy <[email protected]>

---------

Signed-off-by: Gergely Czuczy <[email protected]>
  • Loading branch information
gczuczy authored Mar 10, 2023
1 parent c41dc60 commit c2e0026
Show file tree
Hide file tree
Showing 20 changed files with 96 additions and 87 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-k8s-auth

USER $ARGOCD_USER_ID
ENTRYPOINT ["/usr/bin/tini", "--"]
5 changes: 5 additions & 0 deletions docs/2.7-2.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 2.7 to 2.8

## Tini as entrypoint

With the 2.8 release `entrypoint.sh` will be removed from the containers, because starting with 2.7, the implicit entrypoint is set to `tini` in the `Dockerfile` explicitly, and the kubernetes manifests has been updated to use it. Simply updating the containers without updating the deployment manifests will result in pod startup failures, as the old manifests are relying on `entrypoint.sh` instead of `tini`. Please make sure the manifests are updated properly before moving to 2.8.
6 changes: 6 additions & 0 deletions docs/operator-manual/upgrading/2.6-2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ Note that bundled Helm version has been upgraded from 3.10.3 to 3.11.1.
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.

Masterminds/semver v3 changed the behavior of the `^` prefix in semantic version constraints. If you are using sprig template functions in your notifications templates which include references to [Sprig's semver functions](https://masterminds.github.io/sprig/semver.html) and use the `^` prefix, read the [Masterminds/semver changelog](https://github.com/Masterminds/semver/releases/tag/v3.0.0) to understand how your notifications' behavior may change.

## 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.

[1]: https://github.com/argoproj/argo-cd/pull/12707
1 change: 1 addition & 0 deletions docs/operator-manual/upgrading/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/<v

<hr/>

* [v2.6 to v2.7](./2.6-2.7.md)
* [v2.5 to v2.6](./2.5-2.6.md)
* [v2.4 to v2.5](./2.4-2.5.md)
* [v2.3 to v2.4](./2.3-2.4.md)
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# If we're started as PID 1, we should wrap command execution through tini to
# prevent leakage of orphaned processes ("zombies").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ spec:
app.kubernetes.io/name: argocd-application-controller
spec:
containers:
- command:
- argocd-application-controller
- args:
- /usr/local/bin/argocd-application-controller
env:
- name: ARGOCD_CONTROLLER_REPLICAS
value: "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ spec:
app.kubernetes.io/name: argocd-applicationset-controller
spec:
containers:
- command:
- entrypoint.sh
- argocd-applicationset-controller
- args:
- /usr/local/bin/argocd-applicationset-controller
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
name: argocd-applicationset-controller
Expand Down
2 changes: 1 addition & 1 deletion manifests/base/dex/argocd-dex-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- name: copyutil
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
command: [cp, -n, /usr/local/bin/argocd, /shared/argocd-dex]
command: [/bin/cp, -n, /usr/local/bin/argocd, /shared/argocd-dex]
volumeMounts:
- mountPath: /shared
name: static-files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ spec:
- key: ca.crt
path: ca.crt
containers:
- command:
- argocd-notifications
- args:
- /usr/local/bin/argocd-notifications
workingDir: /app
livenessProbe:
tcpSocket:
Expand Down
7 changes: 5 additions & 2 deletions manifests/base/repo-server/argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ spec:
- name: argocd-repo-server
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
command: [ "sh", "-c", "entrypoint.sh argocd-repo-server --redis $(ARGOCD_REDIS_SERVICE):6379"]
args:
- /usr/local/bin/argocd-repo-server
- "--redis"
- "$(ARGOCD_REDIS_SERVICE):6379"
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down Expand Up @@ -194,7 +197,7 @@ spec:
name: plugins
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
Expand Down
3 changes: 2 additions & 1 deletion manifests/base/server/argocd-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: argocd-server
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
command: [argocd-server]
args:
- /usr/local/bin/argocd-server
env:
- name: ARGOCD_SERVER_INSECURE
valueFrom:
Expand Down
19 changes: 9 additions & 10 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15628,9 +15628,8 @@ spec:
app.kubernetes.io/name: argocd-applicationset-controller
spec:
containers:
- command:
- entrypoint.sh
- argocd-applicationset-controller
- args:
- /usr/local/bin/argocd-applicationset-controller
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -15829,10 +15828,10 @@ spec:
weight: 5
automountServiceAccountToken: false
containers:
- command:
- sh
- -c
- entrypoint.sh argocd-repo-server --redis argocd-redis:6379
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis:6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down Expand Up @@ -16008,7 +16007,7 @@ spec:
name: plugins
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
Expand Down Expand Up @@ -16094,8 +16093,8 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 5
containers:
- command:
- argocd-application-controller
- args:
- /usr/local/bin/argocd-application-controller
env:
- name: ARGOCD_CONTROLLER_REPLICAS
value: "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
spec:
containers:
- name: argocd-application-controller
command:
- argocd-application-controller
args:
- /usr/local/bin/argocd-application-controller
- --redis
- "argocd-redis-ha-haproxy:6379"
5 changes: 2 additions & 3 deletions manifests/ha/base/overlays/argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ spec:
topologyKey: topology.kubernetes.io/zone
containers:
- name: argocd-repo-server
command:
- entrypoint.sh
- argocd-repo-server
args:
- /usr/local/bin/argocd-repo-server
- --redis
- "argocd-redis-ha-haproxy:6379"
4 changes: 2 additions & 2 deletions manifests/ha/base/overlays/argocd-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
env:
- name: ARGOCD_API_SERVER_REPLICAS
value: '2'
command:
- argocd-server
args:
- /usr/local/bin/argocd-server
- --redis
- "argocd-redis-ha-haproxy:6379"
26 changes: 12 additions & 14 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16829,9 +16829,8 @@ spec:
app.kubernetes.io/name: argocd-applicationset-controller
spec:
containers:
- command:
- entrypoint.sh
- argocd-applicationset-controller
- args:
- /usr/local/bin/argocd-applicationset-controller
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -17003,7 +17002,7 @@ spec:
name: argocd-dex-server-tls
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
Expand Down Expand Up @@ -17058,8 +17057,8 @@ spec:
app.kubernetes.io/name: argocd-notifications-controller
spec:
containers:
- command:
- argocd-notifications
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
livenessProbe:
Expand Down Expand Up @@ -17231,9 +17230,8 @@ spec:
topologyKey: kubernetes.io/hostname
automountServiceAccountToken: false
containers:
- command:
- entrypoint.sh
- argocd-repo-server
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down Expand Up @@ -17411,7 +17409,7 @@ spec:
name: plugins
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
Expand Down Expand Up @@ -17495,8 +17493,8 @@ spec:
app.kubernetes.io/name: argocd-server
topologyKey: kubernetes.io/hostname
containers:
- command:
- argocd-server
- args:
- /usr/local/bin/argocd-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down Expand Up @@ -17803,8 +17801,8 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 5
containers:
- command:
- argocd-application-controller
- args:
- /usr/local/bin/argocd-application-controller
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down
26 changes: 12 additions & 14 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1494,9 +1494,8 @@ spec:
app.kubernetes.io/name: argocd-applicationset-controller
spec:
containers:
- command:
- entrypoint.sh
- argocd-applicationset-controller
- args:
- /usr/local/bin/argocd-applicationset-controller
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -1668,7 +1667,7 @@ spec:
name: argocd-dex-server-tls
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
Expand Down Expand Up @@ -1723,8 +1722,8 @@ spec:
app.kubernetes.io/name: argocd-notifications-controller
spec:
containers:
- command:
- argocd-notifications
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:latest
imagePullPolicy: Always
livenessProbe:
Expand Down Expand Up @@ -1896,9 +1895,8 @@ spec:
topologyKey: kubernetes.io/hostname
automountServiceAccountToken: false
containers:
- command:
- entrypoint.sh
- argocd-repo-server
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down Expand Up @@ -2076,7 +2074,7 @@ spec:
name: plugins
initContainers:
- command:
- cp
- /bin/cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
Expand Down Expand Up @@ -2160,8 +2158,8 @@ spec:
app.kubernetes.io/name: argocd-server
topologyKey: kubernetes.io/hostname
containers:
- command:
- argocd-server
- args:
- /usr/local/bin/argocd-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down Expand Up @@ -2468,8 +2466,8 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 5
containers:
- command:
- argocd-application-controller
- args:
- /usr/local/bin/argocd-application-controller
- --redis
- argocd-redis-ha-haproxy:6379
env:
Expand Down
Loading

0 comments on commit c2e0026

Please sign in to comment.