Home

Awesome

Authorino Operator

A Kubernetes Operator to manage Authorino instances.

License codecov FOSSA Status

Installation

The Operator can be installed by applying the manifests to the Kubernetes cluster or using Operator Lifecycle Manager (OLM)

Applying the manifests to the cluster

  1. Install the Operator manifests
make install
  1. Deploy the Operator
make deploy
<details> <summary><i>Tip:</i> Deploy a custom image of the Operator</summary> <br/> To deploy an image of the Operator other than the default <code>quay.io/kuadrant/authorino-operator:latest</code>, specify by setting the <code>OPERATOR_IMAGE</code> parameter. E.g.:
make deploy OPERATOR_IMAGE=authorino-operator:local
</details>

Installing via OLM

To install the Operator using the Operator Lifecycle Manager, you need to make the Operator CSVs available in the cluster by creating a CatalogSource resource.

The bundle and catalog images of the Operator are available in Quay.io:

<table> <tbody> <tr> <th>Bundle</th> <td><a href="https://quay.io/kuadrant/authorino-operator-bundle">quay.io/kuadrant/authorino-operator-bundle</a></td> </tr> <tr> <th>Catalog</th> <td><a href="https://quay.io/kuadrant/authorino-operator-catalog">quay.io/kuadrant/authorino-operator-catalog</a></td> </tr> </tbody> </table>
  1. Create the namespace for the Operator
kubectl create namespace authorino-operator
  1. Create the CatalogSource resource pointing to one of the images from in the Operator's catalog repo:
kubectl -n authorino-operator apply -f -<<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: operatorhubio-catalog
  namespace: authorino-operator
spec:
  sourceType: grpc
  image: quay.io/kuadrant/authorino-operator-catalog:latest
  displayName: Authorino Operator
EOF

Deploy authorino operator using operator-sdk

  1. Install operator-sdk bin
    make operator-sdk
    
  2. Run operator-sdk bundle command
    ./bin/operator-sdk run bundle quay.io/kuadrant/authorino-operator-bundle:latest
    

Note: For s390x & ppc64le , use operator-sdk to install authorino-operator

Requesting an Authorino instance

Once the Operator is up and running, you can request instances of Authorino by creating Authorino CRs. E.g.:

kubectl -n default apply -f -<<EOF
apiVersion: operator.authorino.kuadrant.io/v1beta1
kind: Authorino
metadata:
  name: authorino
spec:
  listener:
    tls:
      enabled: false
  oidcServer:
    tls:
      enabled: false
EOF

The Authorino Custom Resource Definition (CRD)

API to install, manage and configure Authorino authorization services .

Each Authorino Custom Resource (CR) represents an instance of Authorino deployed to the cluster. The Authorino Operator will reconcile the state of the Kubernetes Deployment and associated resources, based on the state of the CR.

API Specification

FieldTypeDescriptionRequired/Default
specAuthorinoSpecSpecification of the Authorino deployment.Required

AuthorinoSpec

FieldTypeDescriptionRequired/Default
clusterWideBooleanSets the Authorino instance's watching scope – cluster-wide or namespaced.Default: true (cluster-wide)
authConfigLabelSelectorsStringLabel selectors used by the Authorino instance to filter AuthConfig-related reconciliation events.Default: empty (all AuthConfigs are watched)
secretLabelSelectorsStringLabel selectors used by the Authorino instance to filter Secret-related reconciliation events (API key and mTLS authentication methods).Default: authorino.kuadrant.io/managed-by=authorino
supersedingHostSubsetsBooleanEnable/disable allowing AuthConfigs to supersede strict subsets of hosts already taken.Default: false
replicasIntegerNumber of replicas desired for the Authorino instance. Values greater than 1 enable leader election in the Authorino service, where the leader updates the statuses of the AuthConfig CRs).Default: 1
evaluatorCacheSizeIntegerCache size (in megabytes) of each Authorino evaluator (when enabled in an AuthConfig).Default: 1
imageStringAuthorino image to be deployed (for dev/testing purpose only).Default: quay.io/kuadrant/authorino:latest
imagePullPolicyStringSets the imagePullPolicy of the Authorino Deployment (for dev/testing purpose only).Default: k8s default
logLevelStringDefines the level of log you want to enable in Authorino (debug, info and error).Default: info
logModeStringDefines the log mode in Authorino (development or production).Default: production
listenerListenerSpecification of the authorization service (gRPC interface).Required
oidcServerOIDCServerSpecification of the OIDC service.Required
tracingTracingConfiguration of the OpenTelemetry tracing exporter.Optional
metricsMetricsConfiguration of the metrics server (port, level).Optional
healthzHealthzConfiguration of the health/readiness probe (port).Optional
volumesVolumesSpecAdditional volumes to be mounted in the Authorino pods.Optional

Listener

Configuration of the authorization server – gRPC and raw HTTP interfaces

FieldTypeDescriptionRequired/Default
portIntegerPort number of authorization server (gRPC interface).DEPRECATED<br/>Use ports instead
portsPortsPort numbers of the authorization server (gRPC and raw HTTPinterfaces).Optional
tlsTLSTLS configuration of the authorization server (GRPC and HTTP interfaces).Required
timeoutIntegerTimeout of external authorization request (in milliseconds), controlled internally by the authorization server.Default: 0 (disabled)

OIDCServer

Configuration of the OIDC Discovery server for Festival Wristband tokens.

FieldTypeDescriptionRequired/Default
portIntegerPort number of OIDC Discovery server for Festival Wristband tokens.Default: 8083
tlsTLSTLS configuration of the OIDC Discovery server for Festival Wristband tokensRequired

TLS

TLS configuration of server. Appears in listener and oidcServer.

FieldTypeDescriptionRequired/Default
enabledBooleanWhether TLS is enabled or disabled for the server.Default: true
certSecretRefLocalObjectReferenceThe reference to the secret that contains the TLS certificates tls.crt and tls.key.Required when enabled: true

Ports

Port numbers of the authorization server.

FieldTypeDescriptionRequired/Default
grpcIntegerPort number of the gRPC interface of the authorization server. Set to 0 to disable this interface.Default: 50001
httpIntegerPort number of the raw HTTP interface of the authorization server. Set to 0 to disable this interface.Default: 5001

Tracing

Configuration of the OpenTelemetry tracing exporter.

FieldTypeDescriptionRequired/Default
endpointStringFull endpoint of the OpenTelemetry tracing collector service (e.g. http://jaeger:14268/api/traces).Required
tagsMapKey-value map of fixed tags to add to all OpenTelemetry traces emitted by Authorino.Optional
insecureBooleanEnable/disable insecure connection to the tracing endpointDefault: false

Metrics

Configuration of the metrics server.

FieldTypeDescriptionRequired/Default
portIntegerPort number of the metrics server.Default: 8080
deepBooleanEnable/disable metrics at the level of each evaluator config (if requested in the AuthConfig) exported by the metrics server.Default: false

Healthz

Configuration of the health/readiness probe (port).

FieldTypeDescriptionRequired/Default
portIntegerPort number of the health/readiness probe.Default: 8081

VolumesSpec

Additional volumes to project in the Authorino pods. Useful for validation of TLS self-signed certificates of external services known to have to be contacted by Authorino at runtime.

FieldTypeDescriptionRequired/Default
items[]VolumeSpecList of additional volume items to project.Optional
defaultModeIntegerMode bits used to set permissions on the files. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.Optional

VolumeSpec

FieldTypeDescriptionRequired/Default
nameStringName of the volume and volume mount within the Deployment. It must be unique in the CR.Optional
mountPathStringAbsolute path where to mount all the items.Required
configMaps[]StringList of of Kubernetes ConfigMap names to mount.Required exactly one of: confiMaps, secrets.
secrets[]StringList of of Kubernetes Secret names to mount.Required exactly one of: confiMaps, secrets.
items[]KeyToPathMount details for selecting specific ConfigMap or Secret entries.Optional

Full example

apiVersion: operator.authorino.kuadrant.io/v1beta1
kind: Authorino
metadata:
  name: authorino
spec:
  clusterWide: true
  authConfigLabelSelectors: environment=production
  secretLabelSelectors: authorino.kuadrant.io/component=authorino,environment=production

  replicas: 2

  evaluatorCacheSize: 2 # mb

  image: quay.io/kuadrant/authorino:latest
  imagePullPolicy: Always

  logLevel: debug
  logMode: production

  listener:
    ports:
      grpc: 50001
      http: 5001
    tls:
      enabled: true
      certSecretRef:
        name: authorino-server-cert # secret must contain `tls.crt` and `tls.key` entries

  oidcServer:
    port: 8083
    tls:
      enabled: true
      certSecretRef:
        name: authorino-oidc-server-cert # secret must contain `tls.crt` and `tls.key` entries

  metrics:
    port: 8080
    deep: true

  volumes:
    items:
      - name: keycloak-tls-cert
        mountPath: /etc/ssl/certs
        configMaps:
          - keycloak-tls-cert
        items: # details to mount the k8s configmap in the authorino pods
          - key: keycloak.crt
            path: keycloak.crt
    defaultMode: 420

Removal

Removing the operator installed via manifests

  1. Undeploy the Operator
make undeploy
  1. Remove the Operator manifests
make uninstall

Remove dependencies (Optional)

  1. Remove operator namespace
make delete-namespace
  1. Uninstall cert manager
make uninstall-cert-manager

License

FOSSA Status