Skip to content

Commit

Permalink
Corrected documentation removed environment variable support and chan…
Browse files Browse the repository at this point in the history
…ged the settings key

Signed-off-by: anandf <anjoseph@redhat.com>
  • Loading branch information
anandf committed Apr 9, 2024
1 parent 7ac49f1 commit 0faa1dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/operator-manual/app-sync-using-impersonation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ kubectl --as <user-to-impersonate> --as-group <group-to-impersonate> ...

In order for an application to use a different service account for the application sync operation, the following steps needs to be performed:

1. The impersonation feature flag should be enabled by setting the value of key `application.impersonation.enabled` to `true` in the `argocd-cmd-params-cm` ConfigMap as below:
1. The impersonation feature flag should be enabled by setting the value of key `application.sync.impersonation.enabled` to `true` in the `argocd-cm` ConfigMap as below:
```yaml
data:
application.impersonation.enabled: true
application.sync.impersonation.enabled: true
```
2. The `AppProject` referenced by the `.spec.project` field of the `Application` must have the `DestinationServiceAccounts` mapping the destination server and namespace to a service account to be used for the sync operation.
Expand All @@ -49,11 +49,11 @@ data:

### Enable application sync with impersonation feature

In order to enable this feature, the Argo CD administrator must reconfigure the `application.impersonation.enabled` settings in the `argocd-cmd-params-cm` ConfigMap as below:
In order to enable this feature, the Argo CD administrator must reconfigure the `application.sync.impersonation.enabled` settings in the `argocd-cm` ConfigMap as below:

```yaml
data:
application.impersonation.enabled: true
application.sync.impersonation.enabled: true
```

## Configuring destination service accounts
Expand Down
3 changes: 3 additions & 0 deletions docs/operator-manual/argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,6 @@ data:
cluster:
name: some-cluster
server: https://some-cluster
# application.sync.impersonation.enabled indicates whether the application sync can be decoupled from control plane service account using impersonation.
application.sync.impersonation.enabled: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ So that, I can use a generic convention of naming service accounts and avoid ass

#### Component: ArgoCD Application Controller

- Provide a configuration in `argocd-cm` which can be modified to enable the Impersonation feature. Set `application.enable.impersonation: true` in the Argo CD ConfigMap. Default value of `application.enable.impersonation` would be `false` and user has to explicitly override it to use this feature.
- Provide an option to override the Impersonation feature using environment variables.
Set `ARGOCD_APPLICATION_CONTROLLER_ENABLE_IMPERSONATION=true` in the Application controller environment variables. Default value of the environment variable must be `false` and user has to explicitly set it to `true` to use this feature.
- Provide an option to enable this feature using a command line flag `--enable-impersonation`. This new argument option needs to be added to the Application controller args.
- Provide a configuration in `argocd-cm` which can be modified to enable the Impersonation feature. Set `application.sync.impersonation.enabled: true` in the Argo CD ConfigMap. Default value of `application.sync.impersonation.enabled` would be `false` and user has to explicitly override it to use this feature.
- Fix Application Controller `sync.go` to set the Impersonate configuration from the AppProject CR to the `SyncContext` Object (rawConfig and restConfig field, need to understand which config is used for the actual sync and if both configs need to be impersonated.)

#### Component: ArgoCD UI
Expand Down Expand Up @@ -195,7 +192,7 @@ kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manif

- Enable the impersonation feature in ArgoCD.
```shell
kubectl set env statefulset/argocd-application-controller ARGOCD_APPLICATION_CONTROLLER_ENABLE_IMPERSONATION=true
kubectl patch cm argocd-cm -n argocd --type json --patch '[{ "op": "add", "path": "/data/application.sync.impersonation.enabled", "value": "true" }]'
```

- Create a namespace called `guestbook` and a service account called `guestbook-deployer`.
Expand Down Expand Up @@ -259,7 +256,7 @@ kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manif

- Enable the impersonation feature in ArgoCD.
```shell
kubectl set env statefulset/argocd-application-controller ARGOCD_APPLICATION_CONTROLLER_ENABLE_IMPERSONATION=true
kubectl patch cm argocd-cm -n argocd --type json --patch '[{ "op": "add", "path": "/data/application.sync.impersonation.enabled", "value": "true" }]'
```

- Create a namespace called `guestbook` and a service account called `guestbook-deployer`.
Expand Down Expand Up @@ -327,7 +324,7 @@ kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manif

- Enable the impersonation feature in ArgoCD.
```shell
kubectl set env statefulset/argocd-application-controller ARGOCD_APPLICATION_CONTROLLER_ENABLE_IMPERSONATION=true
kubectl patch cm argocd-cm -n argocd --type json --patch '[{ "op": "add", "path": "/data/application.sync.impersonation.enabled", "value": "true" }]'
```

- Add the remote cluster as a destination to argocd
Expand Down Expand Up @@ -400,7 +397,7 @@ kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manif

- Enable the impersonation feature in ArgoCD.
```shell
kubectl set env statefulset/argocd-application-controller ARGOCD_APPLICATION_CONTROLLER_ENABLE_IMPERSONATION=true
kubectl patch cm argocd-cm -n argocd --type json --patch '[{ "op": "add", "path": "/data/application.sync.impersonation.enabled", "value": "true" }]'
```

- In the remote cluster, create a service account called `argocd-admin`
Expand Down
2 changes: 1 addition & 1 deletion util/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ const (
RespectRBACValueStrict = "strict"
RespectRBACValueNormal = "normal"
// impersonationEnabledKey is the key to configure whether the application sync decoupling through impersonation feature is enabled
impersonationEnabledKey = "application.impersonation.enabled"
impersonationEnabledKey = "application.sync.impersonation.enabled"
)

var (
Expand Down

0 comments on commit 0faa1dc

Please sign in to comment.