Skip to content

Commit a0edab0

Browse files
Use cert-controller to generate webhook certificates
1 parent abdebf5 commit a0edab0

13 files changed

+167
-145
lines changed

config/default/kustomization.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ commonLabels:
1616
bases:
1717
- ../rbac
1818
- ../manager
19+
- ../webhook
1920
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2021
# - ../prometheus
2122

2223
resources:
2324
- metrics_service.yaml
25+
26+
patches:
27+
- path: manager_webhook_patch.yaml

config/openshift/manager_webhook_patch.yaml renamed to config/default/manager_webhook_patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ spec:
2020
- name: cert
2121
secret:
2222
defaultMode: 420
23-
secretName: codeflare-operator-raycluster-webhook-cert
23+
secretName: webhook-server-cert

config/openshift/kustomization.yaml

-22
This file was deleted.

config/openshift/webhookcainjection_mpatch.yaml

-7
This file was deleted.

config/openshift/webhookcainjection_vpatch.yaml

-7
This file was deleted.

config/rbac/role.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ metadata:
55
creationTimestamp: null
66
name: manager-role
77
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- secrets
12+
verbs:
13+
- get
14+
- list
15+
- update
16+
- watch
17+
- apiGroups:
18+
- admissionregistration.k8s.io
19+
resources:
20+
- mutatingwebhookconfigurations
21+
verbs:
22+
- get
23+
- list
24+
- update
25+
- watch
26+
- apiGroups:
27+
- admissionregistration.k8s.io
28+
resources:
29+
- validatingwebhookconfigurations
30+
verbs:
31+
- get
32+
- list
33+
- update
34+
- watch
835
- apiGroups:
936
- authentication.k8s.io
1037
resources:

config/webhook/kustomization.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
namePrefix: codeflare-operator-
2-
31
resources:
42
- manifests.yaml
53
- service.yaml
4+
- secret.yaml
65

76
configurations:
87
- kustomizeconfig.yaml

config/webhook/secret.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: webhook-server-cert
5+
namespace: system

config/webhook/service.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: webhook-service
5-
namespace: openshift-operators
6-
annotations:
7-
service.beta.openshift.io/serving-cert-secret-name: codeflare-operator-raycluster-webhook-cert
85
spec:
96
ports:
107
- port: 443

go.mod

+19-16
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ go 1.20
55
require (
66
github.com/onsi/ginkgo/v2 v2.11.0
77
github.com/onsi/gomega v1.27.10
8+
github.com/open-policy-agent/cert-controller v0.10.1
89
github.com/openshift/api v0.0.0-20230213134911-7ba313770556
910
github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c
1011
github.com/project-codeflare/codeflare-common v0.0.0-20240207083912-d7a229270a0a
1112
github.com/ray-project/kuberay/ray-operator v1.0.0
1213
go.uber.org/zap v1.26.0
13-
k8s.io/api v0.27.8
14-
k8s.io/apimachinery v0.27.8
15-
k8s.io/client-go v0.27.8
16-
k8s.io/component-base v0.27.8
17-
k8s.io/klog/v2 v2.90.1
18-
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
19-
sigs.k8s.io/controller-runtime v0.15.3
14+
k8s.io/api v0.28.1
15+
k8s.io/apimachinery v0.28.1
16+
k8s.io/client-go v0.28.1
17+
k8s.io/component-base v0.28.1
18+
k8s.io/klog/v2 v2.100.1
19+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
20+
sigs.k8s.io/controller-runtime v0.16.1
2021
sigs.k8s.io/yaml v1.3.0
2122
)
2223

@@ -28,22 +29,22 @@ require (
2829
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
2930
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3031
github.com/davecgh/go-spew v1.1.1 // indirect
31-
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
32-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
32+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
33+
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
3334
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
3435
github.com/fsnotify/fsnotify v1.6.0 // indirect
3536
github.com/go-logr/logr v1.2.4 // indirect
3637
github.com/go-logr/zapr v1.2.4 // indirect
3738
github.com/go-openapi/jsonpointer v0.19.6 // indirect
38-
github.com/go-openapi/jsonreference v0.20.1 // indirect
39+
github.com/go-openapi/jsonreference v0.20.2 // indirect
3940
github.com/go-openapi/swag v0.22.3 // indirect
4041
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
4142
github.com/gogo/protobuf v1.3.2 // indirect
42-
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
43+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
4344
github.com/golang/glog v1.1.2 // indirect
4445
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4546
github.com/golang/protobuf v1.5.3 // indirect
46-
github.com/google/gnostic v0.6.9 // indirect
47+
github.com/google/gnostic-models v0.6.8 // indirect
4748
github.com/google/go-cmp v0.5.9 // indirect
4849
github.com/google/gofuzz v1.2.0 // indirect
4950
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
@@ -66,22 +67,24 @@ require (
6667
github.com/prometheus/procfs v0.12.0 // indirect
6768
github.com/spf13/pflag v1.0.5 // indirect
6869
github.com/stretchr/testify v1.8.4 // indirect
69-
go.uber.org/multierr v1.10.0 // indirect
70+
go.uber.org/atomic v1.11.0 // indirect
71+
go.uber.org/multierr v1.11.0 // indirect
72+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
7073
golang.org/x/net v0.20.0 // indirect
7174
golang.org/x/oauth2 v0.16.0 // indirect
7275
golang.org/x/sys v0.16.0 // indirect
7376
golang.org/x/term v0.16.0 // indirect
7477
golang.org/x/text v0.14.0 // indirect
7578
golang.org/x/time v0.3.0 // indirect
7679
golang.org/x/tools v0.12.0 // indirect
77-
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
80+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7881
google.golang.org/appengine v1.6.7 // indirect
7982
google.golang.org/protobuf v1.32.0 // indirect
8083
gopkg.in/inf.v0 v0.9.1 // indirect
8184
gopkg.in/yaml.v2 v2.4.0 // indirect
8285
gopkg.in/yaml.v3 v3.0.1 // indirect
83-
k8s.io/apiextensions-apiserver v0.27.7 // indirect
84-
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
86+
k8s.io/apiextensions-apiserver v0.28.1 // indirect
87+
k8s.io/kube-openapi v0.0.0-20230901164831-6c774f458599 // indirect
8588
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
8689
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
8790
)

0 commit comments

Comments
 (0)