|
| 1 | +# Install Argo CD |
| 2 | + |
| 3 | +Inspect the prerequisites and the main steps to perform for enabling Argo CD in EDP. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +* [Keycloak is installed](./install-keycloak.md) |
| 8 | +* [EDP is installed](./install-edp.md) |
| 9 | +* Kubectl version 1.18.0 is installed. Please refer to the [Kubernetes official website](https://v1-18.docs.kubernetes.io/docs/setup/release/notes/) for details. |
| 10 | +* [Helm](https://helm.sh) version 3.6.0 is installed. Please refer to the [Helm page](https://github.com/helm/helm/releases/tag/v3.6.0) on GitHub for details. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +Argo CD enablement for EDP consists of two major steps: |
| 15 | + |
| 16 | +* Argo CD integration with EDP (SSO enablement, codebase onboarding, etc.) |
| 17 | +* Argo CD installation |
| 18 | + |
| 19 | +### Integrate With EDP |
| 20 | + |
| 21 | +To enable Argo CD integration, ensure that the `argocd.enabled` flag [values.yaml](https://github.com/epam/edp-install/blob/master/deploy-templates/values.yaml) is set to `true` |
| 22 | + |
| 23 | +### Install With Helm |
| 24 | + |
| 25 | +Argo CD can be installed in many ways, please follow the [official documentation](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/) for more details. |
| 26 | + |
| 27 | +Follow the steps below to install Argo CD using Helm: |
| 28 | + |
| 29 | +* Check out the *values.yaml* file sample of the Argo CD customization, which is based on `HA mode without autoscaling`: |
| 30 | + |
| 31 | + <details> |
| 32 | + <summary><b>View: values.yaml</b></summary> |
| 33 | + |
| 34 | + ```yaml |
| 35 | + redis-ha: |
| 36 | + enabled: true |
| 37 | + |
| 38 | + controller: |
| 39 | + enableStatefulSet: true |
| 40 | + |
| 41 | + server: |
| 42 | + replicas: 2 |
| 43 | + extraArgs: |
| 44 | + - "--insecure" |
| 45 | + env: |
| 46 | + - name: ARGOCD_API_SERVER_REPLICAS |
| 47 | + value: '2' |
| 48 | + ingress: |
| 49 | + enabled: true |
| 50 | + hosts: |
| 51 | + - "argocd.{{ .Values.global.dnsWildCard }}" |
| 52 | + config: |
| 53 | + # required when SSO is enabled |
| 54 | + url: "https://argocd.{{ .Values.global.dnsWildCard }}" |
| 55 | + application.instanceLabelKey: argocd.argoproj.io/instance-edp |
| 56 | + oidc.config: | |
| 57 | + name: Keycloak |
| 58 | + issuer: https://{{ .Values.global.keycloakEndpoint }}/auth/realms/{{ .Values.global.edpName }}-main |
| 59 | + clientID: argocd |
| 60 | + clientSecret: $oidc.keycloak.clientSecret |
| 61 | + requestedScopes: |
| 62 | + - openid |
| 63 | + - profile |
| 64 | + - email |
| 65 | + - groups |
| 66 | + rbacConfig: |
| 67 | + # users may be still be able to login, |
| 68 | + # but will see no apps, projects, etc... |
| 69 | + policy.default: '' |
| 70 | + scopes: '[groups]' |
| 71 | + policy.csv: | |
| 72 | + # default global admins |
| 73 | + g, Argo CDAdmins, role:admin |
| 74 | +
|
| 75 | + configs: |
| 76 | + secret: |
| 77 | + extra: |
| 78 | + oidc.keycloak.clientSecret: "REPLACE" |
| 79 | + |
| 80 | + repoServer: |
| 81 | + replicas: 2 |
| 82 | + |
| 83 | + # we use Keycloak so no DEX is required |
| 84 | + dex: |
| 85 | + enabled: false |
| 86 | + |
| 87 | + # Disabled for multitenancy env with single instance deployment |
| 88 | + applicationSet: |
| 89 | + enabled: false |
| 90 | + ``` |
| 91 | +
|
| 92 | + </details> |
| 93 | +
|
| 94 | + Populate Argo CD values with the values from the EDP [values.yaml](https://github.com/epam/edp-install/blob/master/deploy-templates/values.yaml): |
| 95 | +
|
| 96 | + * .Values.global.dnsWildCard - EDP DNS WildCard |
| 97 | + * .Values.global.keycloakEndpoint - Keycloak Hostname |
| 98 | + * .Values.global.edpName - EDP name |
| 99 | +
|
| 100 | +* Run installation |
| 101 | +
|
| 102 | + ```bash |
| 103 | + kubectl create ns argocd |
| 104 | + helm repo add argo https://argoproj.github.io/argo-helm |
| 105 | + helm install argocd argo/argo-cd -f values.yaml |
| 106 | + ``` |
| 107 | + |
| 108 | +* Update `argocd-secret` secret (in argocd namespace) by providing correct keycloak client secret (`oidc.keycloak.clientSecret`) with value from the `keycloak-client-argocd-secret` secret in EDP namespace and restart the deployment: |
| 109 | + |
| 110 | + ```bash |
| 111 | + ARGOCD_CLIENT=$(kubectl -n <EDP_NAMESPACE> get secret keycloak-client-argocd-secret -o jsonpath='{.data.clientSecret}') |
| 112 | + kubectl -n argocd patch secret argocd-secret -p="{\"data\":{\"oidc.keycloak.clientSecret\": \"${ARGOCD_CLIENT}\"}}" -v=1 |
| 113 | + kubectl -n argocd rollout restart deployment argocd-server |
| 114 | + ``` |
0 commit comments