Example Keycloak
This guide details the deployment of our pre-configured Keycloak SSO server using ArgoCD. This component handles authentication for the SENSE platform and requires specific database and ingress configurations.
1. Environment Dependencies
Section titled â1. Environment DependenciesâThe following resources must exist in the target namespace (sense) before syncing the application. For more information
about chart usage, read the chart readme using helm show readme sense-helm/sense-keycloak.
Required Secrets
Section titled âRequired Secretsâregcred: Credentials for pulling the virnao/stackv-keycloak image.test-kc-auth: Contains the initial admin credentials for Keycloak.Expected key: admin-password (Standard Keycloak chart requirement).
test-keycloak-psql-auth: Credentials for the PostgreSQL database connection.Expected keys: postgres-password (or similar, depending on the bundled Postgres sub-chart).
Infrastructure Requirements
Section titled âInfrastructure RequirementsâCert-Manager: The ingress configuration relies on a ClusterIssuer named le-stackv-cluster. Ensure this resource exists in the cluster.
3.Application Manifest
Section titled â3.Application ManifestâThe configuration uses Helm value substitution to dynamically set hostnames based on the global domain.
File: argocd/keycloak-application.yaml
apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: new-keycloak namespace: argocd finalizers: - resources-finalizer.argocd.argoproj.iospec: project: default source: repoURL: https://stackv.github.io/sense-helm/ chart: sense-keycloak targetRevision: 0.8.0 helm: valuesObject: global: domain: dev3.virnao.com namespaceOverride: sense ingress: annotations: # Ensures TLS certificates are provisioned via Let's Encrypt cert-manager.io/cluster-issuer: le-stackv-cluster # Dynamic Hostnames: # Console: new-kc.dev3.virnao.com # Auth API: new-auth.dev3.virnao.com hostname: new-kc.{{ .Values.global.domain }} authHostname: new-auth.{{ .Values.global.domain }} postgres: database: bitnami_keycloak secret: test-keycloak-psql-auth keycloak: externalDatabase: existingSecret: test-keycloak-psql-auth image: repository: virnao/stackv-keycloak tag: preview pullPolicy: Always pullSecrets: - regcred auth: adminUser: tempadmin existingSecret: test-kc-auth destination: server: https://kubernetes.default.svc # Note: Deployment targets the 'sense' namespace namespace: sense syncPolicy: syncOptions: - CreateNamespace=true4. Setup & Deployment Procedures
Section titled â4. Setup & Deployment Proceduresâ4.1 Registering the Application
Section titled â4.1 Registering the ApplicationâApply the manifest to the ArgoCD control plane.
kubectl apply -f argocd/keycloak-application.yaml -n argocd4.2 Verifying Ingress & TLS
Section titled â4.2 Verifying Ingress & TLSâKeycloak is highly sensitive to correct hostname configuration. After the sync completes:
- Check Ingress Status:
kubectl get ingress -n senseEnsure the ADDRESS field is populated (LoadBalancer IP).
- Verify Certificate Issuance:
kubectl get certificate -n senseEnsure the certificates for new-kc.dev3.virnao.com and new-auth.dev3.virnao.com state Ready: True.
4.3 Initial Access
Section titled â4.3 Initial Accessâ- Navigate to https://new-kc.dev3.virnao.com.
- Click Administration Console.
- Log in using:
- Username:
tempadmin(as defined inkeycloak.auth.adminUser). - Password: The value inside the
test-kc-authsecret.
5. Operational Notes
Section titled â5. Operational Notesâ- Image Tag: The manifest uses
tag: previewwithpullPolicy: Always. This is a moving target. For production stability, pin this to a specific version number. - Database Connectivity: If the Keycloak pod is in
CrashLoopBackOff, it is likely unable to connect to Postgres. Verify thetest-keycloak-psql-authsecret exists in thesensenamespace and contains the correct credentials. - Namespace Isolation: Unlike the Orchestrator (which deployed to
defaultin the previous example), Keycloak deploys tosense. Ensure you are checking the correct namespace when debugging.
