Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.vscode
79 changes: 79 additions & 0 deletions examples/infrastructure/argo-cd/README.md
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd
labels:
name: argocd
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
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
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
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
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"
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
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
Comment thread
kornys marked this conversation as resolved.
source: redhat-operators
sourceNamespace: openshift-marketplace