Skip to content

Commit

Permalink
fix web deployments with AddToScheme for missing resources (#363)
Browse files Browse the repository at this point in the history
* fix web deployments with AddToScheme for missing resources

* make manifests

* make all

* Automated commit: update images.

* undo some of the changes

* Automated commit: update images.
  • Loading branch information
sroettger authored Mar 3, 2022
1 parent ea2d63f commit 2d93c34
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 7 deletions.
27 changes: 26 additions & 1 deletion dist/resources/kctf-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
}
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.14.0+git
operators.operatorframework.io/builder: operator-sdk-v1.17.0+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: kctf-operator.v0.0.1
namespace: placeholder
Expand Down Expand Up @@ -72,6 +72,18 @@ spec:
- patch
- update
- watch
- apiGroups:
- cloud.google.com
resources:
- backendconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -206,6 +218,18 @@ spec:
- get
- patch
- update
- apiGroups:
- networking.gke.io
resources:
- managedcertificates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down Expand Up @@ -304,6 +328,7 @@ spec:
value: 0.0.0.0/0
- name: SECURITY_POLICY
value: kctf-policy

image: eu.gcr.io/kctf-testing/kctf-operator:dev
livenessProbe:
httpGet:
Expand Down
26 changes: 25 additions & 1 deletion dist/resources/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4194,6 +4194,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- cloud.google.com
resources:
- backendconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4328,6 +4340,18 @@ rules:
- get
- patch
- update
- apiGroups:
- networking.gke.io
resources:
- managedcertificates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down Expand Up @@ -4520,7 +4544,7 @@ spec:
value: 0.0.0.0/0
- name: SECURITY_POLICY
value: DISABLED
image: gcr.io/kctf-docker/kctf-operator@sha256:44399c2da5c9ff858a858b7a0163bafc95517345ca94f24b3e782078e5bc4faf
image: gcr.io/kctf-docker/kctf-operator@sha256:12d5b1132b01434f0977e856cd700d98e18fdbfdaaa9959ad25335eb06e83d88
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion kctf-operator/bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=kctf-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.14.0+git
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.17.0+git
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
}
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.14.0+git
operators.operatorframework.io/builder: operator-sdk-v1.17.0+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: kctf-operator.v0.0.1
namespace: placeholder
Expand Down Expand Up @@ -72,6 +72,18 @@ spec:
- patch
- update
- watch
- apiGroups:
- cloud.google.com
resources:
- backendconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -206,6 +218,18 @@ spec:
- get
- patch
- update
- apiGroups:
- networking.gke.io
resources:
- managedcertificates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down
2 changes: 1 addition & 1 deletion kctf-operator/bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: kctf-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.14.0+git
operators.operatorframework.io.metrics.builder: operator-sdk-v1.17.0+git
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down
24 changes: 24 additions & 0 deletions kctf-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- cloud.google.com
resources:
- backendconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -176,6 +188,18 @@ rules:
- get
- patch
- update
- apiGroups:
- networking.gke.io
resources:
- managedcertificates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down
2 changes: 2 additions & 0 deletions kctf-operator/controllers/challenge_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ type ChallengeReconciler struct {
//+kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=cloud.google.com,resources=backendconfigs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=networking.gke.io,resources=managedcertificates,verbs=get;list;watch;create;update;patch;delete

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down
3 changes: 1 addition & 2 deletions kctf-operator/controllers/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ func generateBackendConfig(challenge *kctfv1.Challenge) *backendv1.BackendConfig
Name: challenge.Name,
Namespace: challenge.Namespace,
},
Spec: backendv1.BackendConfigSpec{
},
Spec: backendv1.BackendConfigSpec{},
}
if os.Getenv("SECURITY_POLICY") != "DISABLED" {
config.Spec.SecurityPolicy = &backendv1.SecurityPolicyConfig{
Expand Down
4 changes: 4 additions & 0 deletions kctf-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import (
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

gkenetv1 "github.com/GoogleCloudPlatform/gke-managed-certs/pkg/apis/networking.gke.io/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
backendv1 "k8s.io/ingress-gce/pkg/apis/backendconfig/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand All @@ -47,6 +49,8 @@ func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))

utilruntime.Must(kctfv1.AddToScheme(scheme))
utilruntime.Must(backendv1.AddToScheme(scheme))
utilruntime.Must(gkenetv1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}

Expand Down
24 changes: 24 additions & 0 deletions kctf-operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4194,6 +4194,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- cloud.google.com
resources:
- backendconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4328,6 +4340,18 @@ rules:
- get
- patch
- update
- apiGroups:
- networking.gke.io
resources:
- managedcertificates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down

0 comments on commit 2d93c34

Please sign in to comment.