Skip to content

Commit

Permalink
AuthConfig conversion webhook (#137)
Browse files Browse the repository at this point in the history
* AuthConfig conversion webhook

Deploys the AuthConfig CRD conversion webhook (based on the Authorino container image), as part of deploying the Operator.

This is because the conversion webhook is a single deployment per cluster (similarly to the Operator itself), nevertheless it's based on the Authorino code base (which owns the AuthConfig type and therefore the functions to convert between versions of the CRD).

This change introduces a dependency of the Operator on cert-manager (https://cert-manager.io).

* Script to install the operator + deps without having to clone the repo, nor depending on OLM

* Update Authorino manifests
  • Loading branch information
guicassolato authored Sep 19, 2023
1 parent 75b9f81 commit 261466d
Show file tree
Hide file tree
Showing 14 changed files with 6,096 additions and 91 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ manifests: controller-gen kustomize authorino-manifests ## Generate WebhookConfi

.PHONY: authorino-manifests
authorino-manifests: export AUTHORINO_GITREF := $(AUTHORINO_BRANCH)
authorino-manifests: export AUTHORINO_VERSION := $(AUTHORINO_VERSION)
authorino-manifests: ## Update authorino manifests.
envsubst \
< config/authorino/kustomization.template.yaml \
Expand Down
96 changes: 96 additions & 0 deletions bundle/manifests/authorino-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ spec:
kind: AuthConfig
name: authconfigs.authorino.kuadrant.io
version: v1beta1
- kind: AuthConfig
name: authconfigs.authorino.kuadrant.io
version: v1beta2
- description: API to create instances of authorino
displayName: Authorino
kind: Authorino
Expand Down Expand Up @@ -280,6 +283,45 @@ spec:
runAsNonRoot: true
serviceAccountName: authorino-operator
terminationGracePeriodSeconds: 10
- label:
app: authorino
authorino-component: authorino-webhooks
name: authorino-webhooks
spec:
selector:
matchLabels:
app: authorino
authorino-component: authorino-webhooks
strategy: {}
template:
metadata:
labels:
app: authorino
authorino-component: authorino-webhooks
spec:
containers:
- command:
- authorino
- webhooks
image: quay.io/kuadrant/authorino:latest
name: webhooks
ports:
- containerPort: 9443
name: webhooks
- containerPort: 8080
name: metrics
- containerPort: 8081
name: healthz
resources: {}
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
volumes:
- name: cert
secret:
defaultMode: 420
secretName: authorino-webhook-server-cert
permissions:
- rules:
- apiGroups:
Expand Down Expand Up @@ -314,6 +356,47 @@ spec:
- create
- patch
serviceAccountName: authorino-operator
- rules:
- apiGroups:
- authorino.kuadrant.io
resources:
- authconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- authorino.kuadrant.io
resources:
- authconfigs/status
verbs:
- get
- patch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- list
- update
- apiGroups:
- ""
resources:
- configmaps
- events
verbs:
- create
- get
- list
- update
serviceAccountName: default
strategy: deployment
installModes:
- supported: false
Expand Down Expand Up @@ -347,3 +430,16 @@ spec:
provider:
name: Red Hat
version: 0.0.0
webhookdefinitions:
- admissionReviewVersions:
- v1beta1
- v1beta2
containerPort: 443
conversionCRDs:
- authconfigs.authorino.kuadrant.io
deploymentName: authorino-webhooks
generateName: cauthconfigs.kb.io
sideEffects: None
targetPort: 9443
type: ConversionWebhook
webhookPath: /convert
18 changes: 18 additions & 0 deletions bundle/manifests/authorino-webhooks_v1_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: authorino
authorino-component: authorino-webhooks
name: authorino-webhooks
spec:
ports:
- port: 443
protocol: TCP
targetPort: 9443
selector:
app: authorino
authorino-component: authorino-webhooks
status:
loadBalancer: {}
Loading

0 comments on commit 261466d

Please sign in to comment.