Skip to content

Commit

Permalink
lc/ROX-26523-dev-argocd (#2074)
Browse files Browse the repository at this point in the history
ROX-26523: Install ArgoCD on local dev environment
  • Loading branch information
ludydoo authored Oct 23, 2024
1 parent 7213056 commit cd84fd4
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dev/env/defaults/00-defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export INSTALL_OPENSHIFT_ROUTER_DEFAULT="true"
export EXPOSE_OPENSHIFT_ROUTER_DEFAULT="false"
export INSTALL_VERTICAL_POD_AUTOSCALER_DEFAULT="true"
export INSTALL_VERTICAL_POD_AUTOSCALER_OLM_DEFAULT="false"
export INSTALL_ARGOCD="true"
export INSTALL_OPENSHIFT_GITOPS="false"
export ARGOCD_NAMESPACE="argocd"
export ENABLE_EMAIL_SENDER_DEFAULT="false"
export EMAIL_SENDER_IMAGE_DEFAULT=""

Expand Down
3 changes: 3 additions & 0 deletions dev/env/defaults/cluster-type-openshift/env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ export INSTALL_OPENSHIFT_ROUTER_DEFAULT="false"
export INSTALL_VERTICAL_POD_AUTOSCALER_DEFAULT="false"
export INSTALL_VERTICAL_POD_AUTOSCALER_OLM_DEFAULT="true"
export ENABLE_EXTERNAL_CONFIG_DEFAULT="false"
export INSTALL_ARGOCD="false"
export INSTALL_OPENSHIFT_GITOPS="true"
export ARGOCD_NAMESPACE="openshift-gitops"
2 changes: 2 additions & 0 deletions dev/env/manifests/fleetshard-operator/28-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
fieldPath: metadata.namespace
- name: ADDON_NAME
value: acs-fleetshard-dev
- name: ARGOCD_NAMESPACE
value: "${ARGOCD_NAMESPACE}"
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
4 changes: 4 additions & 0 deletions dev/env/manifests/openshift-gitops/00-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-gitops-operator
7 changes: 7 additions & 0 deletions dev/env/manifests/openshift-gitops/01-operator-group.yaml
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 dev/env/manifests/openshift-gitops/02-subscription.yaml
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: latest
installPlanApproval: Automatic
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
12 changes: 12 additions & 0 deletions dev/env/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ else
log "Skipping installation of Vertical Pod Autoscaler"
fi

if [[ "$INSTALL_ARGOCD" == "true" ]]; then
log "Installing ArgoCD"
kubectl create ns argocd || true
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
elif [[ "$INSTALL_OPENSHIFT_GITOPS" == "true" ]]; then
log "Installing Openshift GitOps"
apply "${MANIFESTS_DIR}/openshift-gitops"
else
log "One of ArgoCD or OpenShift GitOps must be installed"
exit 1
fi

# skip manifests if openshift cluster using is_openshift_cluster
if ! is_openshift_cluster "$CLUSTER_TYPE"; then
apply "${MANIFESTS_DIR}/monitoring"
Expand Down
3 changes: 3 additions & 0 deletions dev/env/scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ INSTALL_OPENSHIFT_ROUTER: ${INSTALL_OPENSHIFT_ROUTER}
EXPOSE_OPENSHIFT_ROUTER: ${EXPOSE_OPENSHIFT_ROUTER}
INSTALL_VERTICAL_POD_AUTOSCALER: ${INSTALL_VERTICAL_POD_AUTOSCALER}
INSTALL_VERTICAL_POD_AUTOSCALER_OLM: ${INSTALL_VERTICAL_POD_AUTOSCALER_OLM}
INSTALL_ARGOCD: ${INSTALL_ARGOCD}
INSTALL_OPENSHIFT_GITOPS: ${INSTALL_OPENSHIFT_GITOPS}
ARGOCD_NAMESPACE: ${ARGOCD_NAMESPACE}
OCM_SERVICE_CLIENT_ID: ********
OCM_SERVICE_CLIENT_SECRET: ********
OCM_SERVICE_TOKEN: ********
Expand Down
2 changes: 1 addition & 1 deletion dev/env/scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ apply "${MANIFESTS_DIR}/fleetshard-operator"

wait_for_container_to_appear "$ACSCS_NAMESPACE" "app=fleetshard-sync" "fleetshard-sync"
if [[ "$SPAWN_LOGGER" == "true" && -n "${LOG_DIR:-}" ]]; then
$KUBECTL -n "$ACSCS_NAMESPACE" logs -l application=fleetshard-sync --all-containers --pod-running-timeout=1m --since=1m --tail=100 -f >"${LOG_DIR}/pod-logs_fleetshard-sync_fleetshard-sync.txt" 2>&1 &
$KUBECTL -n "$ACSCS_NAMESPACE" logs -l app=fleetshard-sync --all-containers --pod-running-timeout=1m --since=1m --tail=100 -f >"${LOG_DIR}/pod-logs_fleetshard-sync_fleetshard-sync.txt" 2>&1 &
fi

if [[ "$ENABLE_EMAIL_SENDER" == "true" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ spec:
{{- end }}
- name: RHACS_PRINT_CENTRAL_UPDATE_DIFF
value: {{ .Values.fleetshardSync.printCentralUpdateDiff | quote }}
- name: ARGOCD_NAMESPACE
value: {{ .Values.fleetshardSync.argoCdNamespace | quote }}
volumeMounts:
- mountPath: /var/run/secrets/tokens
name: tokens
Expand Down
1 change: 1 addition & 0 deletions dp-terraform/helm/rhacs-terraform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fleetshardSync:
name: ""
key: .dockerconfigjson
printCentralUpdateDiff: false
argoCdNamespace: openshift-gitops

# Email sender service parameters
# - enabled flag is used to completely enable/disable email sender service
Expand Down

0 comments on commit cd84fd4

Please sign in to comment.