Deploying the SPIRE OpenID Connect Discovery Provider
Deploy the SPIRE OpenID Connect (OIDC) Discovery Provider by configuring the SpireOIDCDiscoveryProvider CR. This allows you to define the trust domain and JSON web token (JWT) issuer for your cluster.
-
You have access to the cluster as a user with the
cluster-adminrole. -
You have installed Zero Trust Workload Identity Manager in the cluster.
-
Create the
SpireOIDCDiscoveryProviderCR:-
Create a YAML file that defines the
SpireOIDCDiscoveryProviderCR, for example,SpireOIDCDiscoveryProvider.yaml:ExampleSpireOIDCDiscoveryProviderYAMLapiVersion: operator.openshift.io/v1alpha1 kind: SpireOIDCDiscoveryProvider metadata: name: cluster spec: logLevel: "info" logFormat: "text" csiDriverName: "csi.spiffe.io" jwtIssuer: "https://oidc-discovery.apps.cluster.example.com" replicaCount: 1 managedRoute: "true" externalSecretRef: ""where:
metadata.name-
Specifies that the value must be
cluster. spec.logLevel-
Specifies the logging level for the SPIRE Server. The valid options are
debug,info,warn, anderror. spec.logFormat-
Specifies the logging format for the SPIRE Server. The valid options are
textandjson. spec.csiDriverName-
Specifies the name of the CSI driver to use for mounting the Workload API socket. This must match the
SpiffeCSIDriver.spec.pluginNamevalue for the OIDC provider to access SPIFFE identities. Must be a valid DNS subdomain format (for example,csi.spiffe.io) with a maximum length of 127 characters. spec.jwtIssuer-
Specifies the JWT issuer URL. Must be a valid HTTPS or HTTP URL with a maximum length of 512 characters. This value must match the
SpireServer.spec.jwtIssuervalue. spec.replicaCount-
Specifies the number of replicas for the OIDC Discovery Provider deployment. Must be between 1 and 5.
spec.managedRoute-
Specifies whether the Operator automatically creates an OpenShift route for the OIDC Discovery Provider endpoints. Set to
trueto have the Operator automatically create and maintain an OpenShift route for OIDC discovery endpoints (*.apps.). Set tofalsefor administrators to manually configure routes or ingress. spec.externalSecretRef-
Specifies a reference to an externally managed secret that contains the TLS certificate for the OIDC Discovery Provider route host. Must be a valid Kubernetes secret reference name with a maximum length of 253 characters. This field is optional.
-
Apply the configuration by running the following command:
$ oc apply -f SpireOIDCDiscoveryProvider.yaml
-
-
Verify that the deployment of OIDC Discovery Provider is ready and available by running the following command:
$ oc get deployment -l app.kubernetes.io/name=spiffe-oidc-discovery-provider -n zero-trust-workload-identity-managerExample outputNAME READY UP-TO-DATE AVAILABLE AGE spire-spiffe-oidc-discovery-provider 1/1 1 1 2m58s -
Verify that the status of OIDC Discovery Provider pods is
Runningby running the following command:$ oc get po -l app.kubernetes.io/name=spiffe-oidc-discovery-provider -n zero-trust-workload-identity-managerExample outputNAME READY STATUS RESTARTS AGE spire-spiffe-oidc-discovery-provider-64586d599f-lcc94 2/2 Running 0 7m15s