DEV Community

Cover image for Enable OpenShift login on ArgoCD from GitOps Operator
2 1

Enable OpenShift login on ArgoCD from GitOps Operator

Since few weeks now, the operator Red Hat OpenShift GitOps became GA and embbed tools like Tekton and ArgoCD.

When the operator is deployed, it provisions a vanilla ArgoCD which miss the OpenShift integrated login. In this post, we are going to review the steps to enable it.

Deploy and fine tune the Red Hat OpenShift GitOps

  1. Follow the official documentation on the installation of the operator
  2. Once the operator is deployed, go to the menu Operators>Installed Operators and click on the freshly deployed Red Hat OpenShift GitOps
  3. Using the dropdown Actions on top right of the page, choose Edit Subscription
  4. On the YAML code, under the spec level, enable the DEX feature to enable external authentication and click Save
...
spec:
  config:
    env:
      - name: DISABLE_DEX
        value: 'false'
...
Enter fullscreen mode Exit fullscreen mode

or

oc patch subscription openshift-gitops-operator -n openshift-operators --type=merge -p='{"spec":{"config":{"env":[{"name":"DISABLE_DEX","Value":"false"}]}}}'
Enter fullscreen mode Exit fullscreen mode

Configure ArgoCD to allow OpenShift authentication

  1. Change the project to openshift-gitops
  2. Go to the menu Operators>Installed Operators and click on Red Hat OpenShift GitOps, select tab Argo CD
  3. On the ArgoCD instance list, click on the three dots at the very left of the openshift-gitops and select Edit ArgoCD
  4. On the YAML code, under the spec level, update the DEX and RBAC section to match the following
...
spec:
  dex:
    openShiftOAuth: true
  rbac:
    defaultPolicy: 'role:readonly'
    policy: |
      g, system:cluster-admins, role:admin
    scopes: '[groups]'
...
Enter fullscreen mode Exit fullscreen mode

or

oc patch argocd openshift-gitops -n openshift-gitops --type=merge -p='{"spec":{"dex":{"openShiftOAuth":true},"rbac":{"defaultPolicy":"role:readonly","policy":"g, system:cluster-admins, role:admin","scopes":"[groups]"}}}'
Enter fullscreen mode Exit fullscreen mode
  1. Monitor the pods being restared to apply the configuration and test your login

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more