-
Notifications
You must be signed in to change notification settings - Fork 0
Add automation for install ArgoCD on ocp/kubernetes #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| .idea | ||
| .vscode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # ArgoCD Installation with Kustomize | ||
|
|
||
| ## Structure | ||
|
|
||
| - `overlays/` - Platform-specific configurations | ||
| - `openshift/` - OpenShift using `openshift-gitops` operator (Red Hat's version of ArgoCD) from operator catalog (OLM) | ||
| - `kubernetes/` - Kubernetes using direct ArgoCD manifests to install ArgoCD instance and CRDs | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - **OpenShift**: OLM is built-in | ||
| - **Kubernetes**: Nothing | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### OpenShift | ||
|
|
||
| ```bash | ||
| # Install OpenShift GitOps operator (Red Hat's version of ArgoCD) via OLM | ||
| kubectl apply -k overlays/openshift/operator | ||
|
|
||
| # Wait for operator to be ready | ||
| kubectl wait --for=condition=Available deployment/openshift-gitops-operator-controller-manager -n openshift-gitops-operator --timeout=300s | ||
|
|
||
| # Install ArgoCD instance | ||
| kubectl apply -k overlays/openshift/instance | ||
| ``` | ||
|
|
||
| **Note**: OpenShift GitOps is Red Hat's enterprise version and support of the ArgoCD project, providing additional OpenShift integrations and enterprise features. | ||
|
|
||
| ### Kubernetes | ||
|
|
||
| ```bash | ||
| # Install ArgoCD | ||
| kubectl apply -k overlays/kubernetes | ||
| ``` | ||
|
|
||
| ## Access ArgoCD | ||
|
|
||
| ### OpenShift | ||
|
|
||
| OpenShift GitOps creates a route automatically: | ||
|
|
||
| ```bash | ||
| # Get the route URL | ||
| kubectl get route argocd-server -n argocd -o jsonpath='{.spec.host}' | ||
|
|
||
| # Login using openshift auth or Get admin password | ||
| kubectl get secret argocd-cluster -n argocd -o jsonpath='{.data.admin\.password}' | base64 -d | ||
| ``` | ||
|
|
||
| ### Kubernetes | ||
|
|
||
| ```bash | ||
| # Port forward to access locally | ||
| kubectl port-forward service/argocd-server -n argocd 8080:443 | ||
|
|
||
| # Get admin password | ||
| kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d | ||
| ``` | ||
|
|
||
| Then open `https://localhost:8080` in your browser. | ||
|
|
||
| ## Differences Between Platforms | ||
|
|
||
| | Feature | OpenShift | Kubernetes | | ||
| |---------|-----------|------------| | ||
| | Installation | `openshift-gitops` operator (Red Hat) | Direct manifests | | ||
| | Namespace | `argocd` | `argocd` | | ||
| | Access | OpenShift Route (auto TLS) | Port Forward / Ingress | | ||
| | Authentication | OpenShift OAuth integration | Username/password | | ||
| | Updates | Operator managed | Manual manifest updates | | ||
|
|
||
| ## Customization | ||
|
|
||
| You can customize the installation by: | ||
|
|
||
| 1. Modifying the ArgoCD custom resource in the overlays | ||
| 2. Adding additional configuration patches |
14 changes: 14 additions & 0 deletions
14
examples/infrastructure/argo-cd/overlays/kubernetes/kustomization.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| resources: | ||
| - namespace.yaml | ||
| - https://raw.githubusercontent.com/argoproj/argo-cd/v3.3.0/manifests/install.yaml | ||
|
|
||
| namespace: argocd | ||
|
|
||
| labels: | ||
| - pairs: | ||
| app.kubernetes.io/name: argocd | ||
| app.kubernetes.io/part-of: argocd | ||
| app.kubernetes.io/managed-by: kustomize |
6 changes: 6 additions & 0 deletions
6
examples/infrastructure/argo-cd/overlays/kubernetes/namespace.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: argocd | ||
| labels: | ||
| name: argocd |
93 changes: 93 additions & 0 deletions
93
examples/infrastructure/argo-cd/overlays/openshift/instance/argocd.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| apiVersion: argoproj.io/v1beta1 | ||
| kind: ArgoCD | ||
| metadata: | ||
| name: argocd | ||
| namespace: argocd | ||
| spec: | ||
| server: | ||
| replicas: 2 | ||
| resources: | ||
| limits: | ||
| cpu: 500m | ||
| memory: 256Mi | ||
| requests: | ||
| cpu: 125m | ||
| memory: 128Mi | ||
| route: | ||
| enabled: true | ||
| tls: | ||
| termination: reencrypt | ||
| service: | ||
| type: '' | ||
| ingress: | ||
| enabled: false | ||
|
|
||
| repo: | ||
| replicas: 2 | ||
| resources: | ||
| limits: | ||
| cpu: 1000m | ||
| memory: 1Gi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 256Mi | ||
|
|
||
| controller: | ||
| resources: | ||
| limits: | ||
| cpu: 2000m | ||
| memory: 2Gi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 1Gi | ||
| processors: | ||
| operation: 10 | ||
| status: 20 | ||
|
|
||
| redis: | ||
| resources: | ||
| limits: | ||
| cpu: 500m | ||
| memory: 256Mi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 128Mi | ||
|
|
||
| resourceExclusions: | | ||
| - apiGroups: | ||
| - tekton.dev | ||
| clusters: | ||
| - '*' | ||
| kinds: | ||
| - TaskRun | ||
| - PipelineRun | ||
|
|
||
| sso: | ||
| provider: dex | ||
| dex: | ||
| openShiftOAuth: true | ||
| resources: | ||
| limits: | ||
| cpu: 500m | ||
| memory: 256Mi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 128Mi | ||
|
|
||
| ha: | ||
| enabled: false | ||
| rbac: | ||
| defaultPolicy: 'role:readonly' | ||
| policy: | | ||
| g, system:cluster-admins, role:admin | ||
| g, cluster-admins, role:admin | ||
| scopes: '[groups]' | ||
|
|
||
| applicationSet: | ||
| resources: | ||
| limits: | ||
| cpu: 1000m | ||
| memory: 1Gi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 512Mi |
6 changes: 6 additions & 0 deletions
6
examples/infrastructure/argo-cd/overlays/openshift/instance/kustomization.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| resources: | ||
| - namespace.yaml | ||
| - argocd.yaml |
7 changes: 7 additions & 0 deletions
7
examples/infrastructure/argo-cd/overlays/openshift/instance/namespace.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: argocd | ||
| labels: | ||
| name: argocd | ||
| argocd.argoproj.io/managed-by: openshift-gitops |
7 changes: 7 additions & 0 deletions
7
examples/infrastructure/argo-cd/overlays/openshift/operator/kustomization.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| resources: | ||
| - namespace.yaml | ||
| - operatorgroup.yaml | ||
| - subscription.yaml |
7 changes: 7 additions & 0 deletions
7
examples/infrastructure/argo-cd/overlays/openshift/operator/namespace.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: openshift-gitops-operator | ||
| labels: | ||
| name: openshift-gitops-operator | ||
| openshift.io/cluster-monitoring: "true" |
7 changes: 7 additions & 0 deletions
7
examples/infrastructure/argo-cd/overlays/openshift/operator/operatorgroup.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| name: openshift-gitops-operator | ||
| namespace: openshift-gitops-operator | ||
| spec: | ||
| upgradeStrategy: Default |
11 changes: 11 additions & 0 deletions
11
examples/infrastructure/argo-cd/overlays/openshift/operator/subscription.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: openshift-gitops-operator | ||
| namespace: openshift-gitops-operator | ||
| spec: | ||
| channel: gitops-1.19 | ||
| installPlanApproval: Automatic | ||
| name: openshift-gitops-operator | ||
| source: redhat-operators | ||
| sourceNamespace: openshift-marketplace | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.