diff --git a/Dockerfile b/Dockerfile index 9195882ea72e..b1c1b85dbcc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,10 @@ WORKDIR /hypershift COPY . . RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o bin/hypershift-operator hypershift-operator/main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o bin/control-plane-operator control-plane-operator/main.go RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o bin/hosted-cluster-config-operator hosted-cluster-config-operator/main.go FROM quay.io/openshift/origin-base:4.6 COPY --from=builder /hypershift/bin/hypershift-operator /usr/bin/hypershift-operator +COPY --from=builder /hypershift/bin/control-plane-operator /usr/bin/control-plane-operator COPY --from=builder /hypershift/bin/hosted-cluster-config-operator /usr/bin/hosted-cluster-config-operator diff --git a/HACKING.md b/HACKING.md index 91d906d32863..48fde50f90c5 100644 --- a/HACKING.md +++ b/HACKING.md @@ -3,9 +3,10 @@ ## Development How-to Guides -### Run the operator in a local process +### Run the HyperShift Operator in a local process -1. Ensure KUBECONFIG points to a management cluster with no HyperShift installed yet. +1. Ensure the `KUBECONFIG` evnvironment variable points to a management cluster + with no HyperShift installed yet. 2. Build HyperShift. @@ -16,11 +17,12 @@ make install PROFILE=development -4. Run the HyperShift operator locally. +4. Run the HyperShift operator locally. Replace `IMAGE` with a custom image, + if desired. This image is used for the Control Plane Operator. - make run-local + make run-local IMAGE=registry.ci.openshift.org/hypershift/hypershift -### Run custom operator images +### Run a custom image using the production profile 1. Build and push a custom image build to your own repository. @@ -31,8 +33,7 @@ make install PROFILE=production 3. Reconfigure the HyperShift operator deployment to use your custom image. - This will also cause the image you specify to be used for the hosted cluster - config operator as well. + This image will also be used for the control plane operator. oc --namespace hypershift set image deployment/operator operator=quay.io/my/hypershift:latest diff --git a/Makefile b/Makefile index 9b97da656434..09c26da466fc 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ GO_BUILD_RECIPE=CGO_ENABLED=0 $(GO) build $(GO_GCFLAGS) # Kustomize overlay to use PROFILE ?= production +EXAMPLE_NAMESPACE ?= hypershift + # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin @@ -26,19 +28,26 @@ endif all: build manifests -build: hypershift-operator hosted-cluster-config-operator +build: hypershift-operator control-plane-operator hosted-cluster-config-operator verify: build fmt vet # Generate code generate: - $(BINDATA) -mode 420 -modtime 1 -pkg hypershift \ - -o ./hypershift-operator/assets/controlplane/hypershift/bindata.go \ - --prefix hypershift-operator/assets/controlplane/hypershift \ + $(BINDATA) -mode 420 -modtime 1 -pkg assets \ + -o ./hypershift-operator/controllers/hostedcluster/assets/bindata.go \ + --prefix hypershift-operator/controllers/hostedcluster/assets \ + --ignore bindata.go \ + ./hypershift-operator/controllers/hostedcluster/assets/... + + $(BINDATA) -mode 420 -modtime 1 -pkg assets \ + -o ./control-plane-operator/controllers/hostedcontrolplane/assets/bindata.go \ + --prefix control-plane-operator/controllers/hostedcontrolplane/assets \ --ignore bindata.go \ - ./hypershift-operator/assets/controlplane/hypershift/... + ./control-plane-operator/controllers/hostedcontrolplane/assets/... - gofmt -s -w ./hypershift-operator/assets/controlplane/hypershift/bindata.go + gofmt -s -w ./hypershift-operator/controllers/hostedcluster/assets/bindata.go + gofmt -s -w ./control-plane-operator/controllers/hostedcontrolplane/assets/bindata.go $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." @@ -46,6 +55,9 @@ generate: hypershift-operator: generate $(GO_BUILD_RECIPE) -o bin/hypershift-operator ./hypershift-operator +control-plane-operator: generate + $(GO_BUILD_RECIPE) -o bin/control-plane-operator ./control-plane-operator + # Build hosted-cluster-config-operator binary hosted-cluster-config-operator: generate $(GO_BUILD_RECIPE) -o bin/hosted-cluster-config-operator ./hosted-cluster-config-operator @@ -88,7 +100,7 @@ docker-push: ${RUNTIME} push ${IMG} run-local: - bin/hypershift-operator run + bin/hypershift-operator run --operator-image=$(IMAGE) BUILD_EXAMPLE_CLUSTER=KUSTOMIZE_PLUGIN_HOME=$(DIR)/config/example-cluster/plugin kustomize build --enable_alpha_plugins ./config/example-cluster @@ -96,7 +108,7 @@ example-cluster: $(BUILD_EXAMPLE_CLUSTER) install-example-cluster: - $(BUILD_EXAMPLE_CLUSTER) | oc apply --namespace hypershift -f - + $(BUILD_EXAMPLE_CLUSTER) | oc apply --namespace $(EXAMPLE_NAMESPACE) -f - .PHONY: test-e2e test-e2e: ## Run the e2e tests diff --git a/config/hypershift-operator/operator-deployment.yaml b/config/hypershift-operator/operator-deployment.yaml index ad74136fb798..ac4308991f58 100644 --- a/config/hypershift-operator/operator-deployment.yaml +++ b/config/hypershift-operator/operator-deployment.yaml @@ -18,7 +18,10 @@ spec: - name: operator image: hypershift:latest imagePullPolicy: Always - command: - - /usr/bin/hypershift-operator - args: - - run + env: + - name: MY_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + command: [ "/usr/bin/hypershift-operator" ] + args: [ "run", "--namespace", "$(MY_NAMESPACE)", "--deployment-name", "operator" ] diff --git a/hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/apiserver-ip.service b/control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/apiserver-ip.service similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/apiserver-ip.service rename to control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/apiserver-ip.service diff --git a/hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/haproxy.cfg b/control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/haproxy.cfg similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/haproxy.cfg rename to control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/haproxy.cfg diff --git a/hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/kube-apiserver-proxy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/kube-apiserver-proxy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/kube-apiserver-proxy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/kube-apiserver-proxy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/setup-apiserver-ip.sh b/control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/setup-apiserver-ip.sh similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/setup-apiserver-ip.sh rename to control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/setup-apiserver-ip.sh diff --git a/hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/teardown-apiserver-ip.sh b/control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/teardown-apiserver-ip.sh similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/teardown-apiserver-ip.sh rename to control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/teardown-apiserver-ip.sh diff --git a/hypershift-operator/assets/controlplane/hypershift/bindata.go b/control-plane-operator/controllers/hostedcontrolplane/assets/bindata.go similarity index 97% rename from hypershift-operator/assets/controlplane/hypershift/bindata.go rename to control-plane-operator/controllers/hostedcontrolplane/assets/bindata.go index 2a045d58f6b4..bc761f66eb00 100644 --- a/hypershift-operator/assets/controlplane/hypershift/bindata.go +++ b/control-plane-operator/controllers/hostedcontrolplane/assets/bindata.go @@ -1,162 +1,153 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/apiserver-ip.service (299B) -// hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/haproxy.cfg (393B) -// hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/kube-apiserver-proxy.yaml (709B) -// hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/setup-apiserver-ip.sh (206B) -// hypershift-operator/assets/controlplane/hypershift/apiserver-haproxy/teardown-apiserver-ip.sh (168B) -// hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrole.yaml (2.963kB) -// hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrolebinding.yaml (303B) -// hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-deployment.yaml (1.378kB) -// hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-serviceaccount.yaml (77B) -// hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrole.yaml (1.113kB) -// hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrolebinding.yaml (266B) -// hypershift-operator/assets/controlplane/hypershift/capi/manager-deployment.yaml (516B) -// hypershift-operator/assets/controlplane/hypershift/capi/manager-serviceaccount.yaml (66B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml (770B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-config-v1-configmap.yaml (338B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-dns-02-config.yaml (146B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-infrastructure-02-config.yaml (577B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-ingress-02-config.yaml (268B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml (589B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-01-crd.yaml (513B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-02-config.yaml (284B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-proxy-01-config.yaml (142B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-version-namespace.yaml (74B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml (587B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml (505B) -// hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml (347B) -// hypershift-operator/assets/controlplane/hypershift/cluster-version-operator/cluster-version-operator-deployment.yaml (2.31kB) -// hypershift-operator/assets/controlplane/hypershift/common/service-network-admin-kubeconfig-secret.yaml (137B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster-crd.yaml (444B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster.yaml (265B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role-binding.yaml (272B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role.yaml (646B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-serviceaccount.yaml (68B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator.yaml (643B) -// hypershift-operator/assets/controlplane/hypershift/etcd/etcd-secret-template.yaml (220B) -// hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-configmap.yaml (145B) -// hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-deployment.yaml (2.877kB) -// hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-role.yaml (517B) -// hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-rolebinding.yaml (279B) -// hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml (123B) -// hypershift-operator/assets/controlplane/hypershift/hypershift-operator/hypershift-operator-configmap.yaml (134B) -// hypershift-operator/assets/controlplane/hypershift/ignition-configs/20-apiserver-haproxy.yaml (1.335kB) -// hypershift-operator/assets/controlplane/hypershift/ignition-configs/99-worker-ssh.yaml (321B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/client.conf (139B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/config.yaml (6.23kB) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/default-audit-policy.yaml (482B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-config-configmap.yaml (140B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-configmap.yaml (380B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-default-audit-policy.yaml (159B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment-patch.yaml (971B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment.yaml (4.393kB) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml (132B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml (162B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-secret.yaml (592B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-service.yaml (253B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-config.yaml (150B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-secret.yaml (235B) -// hypershift-operator/assets/controlplane/hypershift/kube-apiserver/oauthMetadata.json (917B) -// hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/config.yaml (1.531kB) -// hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-config-configmap.yaml (158B) -// hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-configmap.yaml (194B) -// hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-deployment.yaml (4.787kB) -// hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-secret.yaml (289B) -// hypershift-operator/assets/controlplane/hypershift/kube-scheduler/config.yaml (185B) -// hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-config-configmap.yaml (140B) -// hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-deployment.yaml (3.273kB) -// hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-secret.yaml (119B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-dns-02-config.yaml (109B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-infrastructure-02-config.yaml (537B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-network-02-config.yaml (258B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-proxy-01-config.yaml (116B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/install-config.yaml (103B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-configmap.yaml (1.001kB) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-deployment.yaml (5.396kB) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-kubeconfig-secret.yaml (153B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-rolebinding.yaml (242B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-secret.yaml (185B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-service.yaml (212B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-serviceaccount.yaml (76B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/master.machineconfigpool.yaml (344B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/pull-secret.yaml (175B) -// hypershift-operator/assets/controlplane/hypershift/machine-config-server/worker.machineconfigpool.yaml (418B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/audit-policy.yaml (468B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-auditpolicy.yaml (163B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-configmap.yaml (188B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-deployment.yaml (3.43kB) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-secret.yaml (330B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-service.yaml (224B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-endpoint.yaml (208B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-service.yaml (139B) -// hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/service-template.yaml (310B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/ingress-certs-secret.yaml (194B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-browser-client.yaml (379B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-challenging-client.yaml (383B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config-configmap.yaml (155B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config.yaml (2.711kB) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-configmap.yaml (122B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-deployment.yaml (4.225kB) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-secret.yaml (216B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-service.yaml (222B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-sessionsecret-secret.yaml (194B) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-branding.yaml (637.991kB) -// hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-session.json (179B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/config.yaml (1.813kB) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-config-configmap.yaml (150B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-configmap.yaml (248B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-deployment.yaml (3.615kB) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-secret.yaml (332B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-service.yaml (216B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-endpoint.yaml (206B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-service.yaml (132B) -// hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/service-template.yaml (308B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml (247B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/cluster-policy-controller-deployment.yaml (3.029kB) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/config.yaml (627B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml (168B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-configmap.yaml (140B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-deployment.yaml (3kB) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-secret.yaml (265B) -// hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-service-ca.yaml (190B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/Dockerfile (212B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/client.conf (155B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-ccd-configmap.yaml (113B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-configmap.yaml (151B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-deployment.yaml (1.67kB) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-secret.yaml (364B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-configmap.yaml (126B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-deployment.yaml (1.61kB) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-secret.yaml (188B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-service.yaml (221B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-serviceaccount.yaml (58B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/server.conf (803B) -// hypershift-operator/assets/controlplane/hypershift/openvpn/worker (108B) -// hypershift-operator/assets/controlplane/hypershift/registry/cluster-imageregistry-config.yaml (542B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-00-namespace.yaml (126B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-deployment.yaml (1.128kB) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-deployment.yaml (810B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-service.yaml (264B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml (284B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-rbac.yaml (1.159kB) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-service.yaml (340B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-serviceaccount.yaml (103B) -// hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-servicemonitor.yaml (699B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/client.conf (139B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/haproxy.cfg (515B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-configmap.yaml (136B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-deployment.yaml (2.707kB) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-http-service.yaml (175B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-https-service.yaml (179B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-configmap.yaml (146B) -// hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-secret.yaml (229B) -// hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifest-template.yaml (104B) -// hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml (2.056kB) -// hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml (254B) -// hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml (82B) - -package hypershift +// control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/apiserver-ip.service (299B) +// control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/haproxy.cfg (393B) +// control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/kube-apiserver-proxy.yaml (709B) +// control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/setup-apiserver-ip.sh (206B) +// control-plane-operator/controllers/hostedcontrolplane/assets/apiserver-haproxy/teardown-apiserver-ip.sh (168B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml (770B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-config-v1-configmap.yaml (338B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-dns-02-config.yaml (146B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-infrastructure-02-config.yaml (577B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-ingress-02-config.yaml (268B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml (589B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-01-crd.yaml (513B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-02-config.yaml (284B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-proxy-01-config.yaml (142B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-version-namespace.yaml (74B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml (587B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml (505B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml (347B) +// control-plane-operator/controllers/hostedcontrolplane/assets/cluster-version-operator/cluster-version-operator-deployment.yaml (2.31kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/common/service-network-admin-kubeconfig-secret.yaml (137B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster-crd.yaml (444B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster.yaml (265B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role-binding.yaml (272B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role.yaml (646B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-serviceaccount.yaml (68B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator.yaml (643B) +// control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-secret-template.yaml (220B) +// control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-configmap.yaml (145B) +// control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-deployment.yaml (2.885kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-role.yaml (517B) +// control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-rolebinding.yaml (279B) +// control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml (123B) +// control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/20-apiserver-haproxy.yaml (1.335kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/99-worker-ssh.yaml (321B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/client.conf (139B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/config.yaml (6.23kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/default-audit-policy.yaml (482B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-config-configmap.yaml (140B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-configmap.yaml (380B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-default-audit-policy.yaml (159B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment-patch.yaml (971B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment.yaml (4.393kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml (132B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml (162B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-secret.yaml (592B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-service.yaml (253B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-config.yaml (150B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-secret.yaml (235B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/oauthMetadata.json (917B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/config.yaml (1.531kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-config-configmap.yaml (158B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-configmap.yaml (194B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-deployment.yaml (4.787kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-secret.yaml (289B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/config.yaml (185B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-config-configmap.yaml (140B) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-deployment.yaml (3.273kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-secret.yaml (119B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-dns-02-config.yaml (109B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-infrastructure-02-config.yaml (537B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-network-02-config.yaml (258B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-proxy-01-config.yaml (116B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/install-config.yaml (103B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-configmap.yaml (1.001kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-deployment.yaml (5.396kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-kubeconfig-secret.yaml (153B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-rolebinding.yaml (242B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-secret.yaml (185B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-service.yaml (212B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-serviceaccount.yaml (76B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/master.machineconfigpool.yaml (344B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/pull-secret.yaml (175B) +// control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/worker.machineconfigpool.yaml (418B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/audit-policy.yaml (468B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-auditpolicy.yaml (163B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-configmap.yaml (188B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-deployment.yaml (3.43kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-secret.yaml (330B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-service.yaml (224B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-endpoint.yaml (208B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-service.yaml (139B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/service-template.yaml (310B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/ingress-certs-secret.yaml (194B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-browser-client.yaml (379B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-challenging-client.yaml (383B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config-configmap.yaml (155B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config.yaml (2.711kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-configmap.yaml (122B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-deployment.yaml (4.225kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-secret.yaml (216B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-service.yaml (222B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-sessionsecret-secret.yaml (194B) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-branding.yaml (637.991kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-session.json (179B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/config.yaml (1.813kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-config-configmap.yaml (150B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-configmap.yaml (248B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-deployment.yaml (3.615kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-secret.yaml (332B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-service.yaml (216B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-endpoint.yaml (206B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-service.yaml (132B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/service-template.yaml (308B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml (247B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/cluster-policy-controller-deployment.yaml (3.029kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/config.yaml (627B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml (168B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-configmap.yaml (140B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-deployment.yaml (3kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-secret.yaml (265B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-service-ca.yaml (190B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/Dockerfile (212B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/client.conf (155B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-ccd-configmap.yaml (113B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-configmap.yaml (151B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-deployment.yaml (1.67kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-secret.yaml (364B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-configmap.yaml (126B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-deployment.yaml (1.61kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-secret.yaml (188B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-service.yaml (221B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-serviceaccount.yaml (58B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/server.conf (803B) +// control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/worker (108B) +// control-plane-operator/controllers/hostedcontrolplane/assets/registry/cluster-imageregistry-config.yaml (542B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-00-namespace.yaml (126B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-deployment.yaml (1.128kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-deployment.yaml (810B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-service.yaml (264B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml (284B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-rbac.yaml (1.159kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-service.yaml (340B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-serviceaccount.yaml (103B) +// control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-servicemonitor.yaml (699B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/client.conf (139B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/haproxy.cfg (515B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-configmap.yaml (136B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-deployment.yaml (2.707kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-http-service.yaml (175B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-https-service.yaml (179B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-configmap.yaml (146B) +// control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-secret.yaml (229B) +// control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifest-template.yaml (104B) +// control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml (2.056kB) +// control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml (254B) +// control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml (82B) + +package assets import ( "bytes" @@ -323,166 +314,6 @@ func apiserverHaproxyTeardownApiserverIpSh() (*asset, error) { return a, nil } -var _capiCapaManagerClusterroleYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x94\xc1\x6e\xa3\x40\x0c\x86\xef\x3c\xc5\x28\x17\xa4\x48\x10\xed\x6d\xc5\x75\x0f\x7b\x5f\xad\x7a\x77\x06\x27\x8c\x32\xcc\x8c\x6c\x4f\x92\xf6\xe9\xab\x40\x94\xd2\x12\x54\xd2\x92\x36\x0d\xa7\xb1\xcd\x2f\x3e\xff\x63\x0c\xc1\x3c\x20\xb1\xf1\xae\x50\xb4\x04\x9d\x43\x94\xca\x93\x79\x02\x31\xde\xe5\x9b\xdf\x9c\x1b\xbf\xd8\xfe\x4a\x36\xc6\x95\x85\xfa\x63\x23\x0b\xd2\x3f\x6f\x31\xa9\x51\xa0\x04\x81\x22\x51\x4a\x13\x36\x82\xff\xa6\x46\x16\xa8\x43\xa1\x5c\xb4\x36\x51\xca\x41\x8d\x85\xd2\x10\x20\xab\xc1\xc1\x1a\x29\xa3\x83\x9a\xa2\x45\x3e\x48\x33\x05\xc1\xfc\x25\x1f\x43\x13\x1e\x9e\x4c\xcd\x66\xcd\x91\x90\x7d\x24\x8d\x9d\x0a\x6e\xd1\x09\x37\xe1\x16\x69\xd9\xa9\x34\x0c\x78\x0a\xd7\x28\xa7\xb3\x35\xfc\x12\x04\x10\x5d\x9d\xa2\x18\xca\xae\x6a\x77\x2c\x5e\x48\xc5\xa8\x09\x47\x61\x95\x68\xf1\xba\x94\xba\xbd\xa3\x7c\x9f\xb5\xb7\x37\xc4\x7c\x7c\x8f\x7b\x89\x05\x0b\x48\x3c\xdb\xcc\x20\xee\x24\x44\x35\xe8\xca\x38\xe4\x5e\x62\x7a\x22\xef\x84\xbc\x0d\x16\x1c\xe6\x63\xf1\x60\xc7\xed\x08\x97\x5d\x39\xbf\x57\x9f\x1c\x1e\xf7\x61\x34\xf3\xd1\xc1\xe0\xbd\xed\xd9\xda\x24\x27\xa7\x33\x6e\x45\xc0\x42\x51\x4b\xa4\x8b\xcc\x7d\x35\x90\xdf\xfd\x17\x7d\xbe\x8d\x91\xce\x0e\x20\x4e\x0c\xd5\x9b\x83\x9f\xeb\xef\x07\xa6\xf7\x4b\x3d\xbe\x13\x7f\x6f\xcd\xdb\x76\xb1\xde\xc7\x8a\x78\xd3\xcd\x2d\x3a\x7d\x57\x0b\xa3\xd7\xd1\x15\x1c\xaf\x1e\x03\x12\x57\x66\x25\xb9\x0f\xe8\xda\xd3\x30\x57\x3a\x4f\xcf\x7d\x3d\x9d\xa7\xcf\x01\x00\x00\xff\xff\xfd\xe2\xfa\x51\x93\x0b\x00\x00") - -func capiCapaManagerClusterroleYamlBytes() ([]byte, error) { - return bindataRead( - _capiCapaManagerClusterroleYaml, - "capi/capa-manager-clusterrole.yaml", - ) -} - -func capiCapaManagerClusterroleYaml() (*asset, error) { - bytes, err := capiCapaManagerClusterroleYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/capa-manager-clusterrole.yaml", size: 2963, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0xef, 0x4a, 0x71, 0xb7, 0x5d, 0xb, 0xf2, 0xfe, 0xd5, 0x6a, 0x40, 0xd1, 0xd7, 0x9a, 0x75, 0xd4, 0x91, 0xf2, 0xaf, 0x32, 0x5f, 0xe9, 0x8c, 0x6b, 0x9, 0x15, 0xde, 0x61, 0xfd, 0x5f, 0x4a}} - return a, nil -} - -var _capiCapaManagerClusterrolebindingYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8d\xb1\x4a\x04\x41\x0c\x86\xfb\x79\x8a\xbc\xc0\x8e\xd8\xc9\x74\x6a\x61\x67\x71\x82\x7d\x36\x1b\xcf\x78\xb3\xc9\x90\xc9\x5c\xe1\x71\xef\x2e\x0b\x77\x82\x88\x76\x09\x7c\xff\xf7\x61\x93\x57\xf6\x2e\xa6\x05\x7c\x46\xca\x38\xe2\xdd\x5c\x3e\x31\xc4\x34\x1f\xee\x7a\x16\xbb\x39\xde\xa6\x83\xe8\x52\xe0\xb1\x8e\x1e\xec\x3b\xab\xfc\x20\xba\x88\xee\xd3\xca\x81\x0b\x06\x96\x04\xa0\xb8\x72\x01\xc2\x86\xd3\x8a\x8a\x7b\xf6\xc9\xad\xf2\x7c\x41\xb7\x7b\xc7\x6f\x1b\x89\x4d\x9e\xdc\x46\xfb\xa7\x9a\x00\x7e\x45\xff\x6e\xa4\x3e\xe6\x0f\xa6\xe8\x9b\x7d\xba\x2c\x5f\xd8\x8f\x42\x7c\x4f\x64\x43\x23\x01\xfc\x98\x93\x69\xb8\xd5\xca\x7e\x35\x7d\x13\xbd\x21\x71\x81\xd3\x09\xf2\xf3\xf5\x85\xf3\x39\x7d\x05\x00\x00\xff\xff\x19\xd2\x37\xd4\x2f\x01\x00\x00") - -func capiCapaManagerClusterrolebindingYamlBytes() ([]byte, error) { - return bindataRead( - _capiCapaManagerClusterrolebindingYaml, - "capi/capa-manager-clusterrolebinding.yaml", - ) -} - -func capiCapaManagerClusterrolebindingYaml() (*asset, error) { - bytes, err := capiCapaManagerClusterrolebindingYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/capa-manager-clusterrolebinding.yaml", size: 303, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x15, 0xa9, 0x96, 0x70, 0xae, 0x9, 0x18, 0x78, 0x87, 0x84, 0xfb, 0x4, 0xac, 0x2d, 0x55, 0x64, 0x55, 0xf5, 0xab, 0x37, 0xf6, 0xbe, 0xa2, 0x5f, 0x7, 0xa7, 0x9c, 0x39, 0xb5, 0x22, 0xb3, 0x4b}} - return a, nil -} - -var _capiCapaManagerDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x54\xdd\x4e\xe3\x3c\x10\xbd\xcf\x53\xf8\x05\xd2\x7e\x48\xdc\x7c\x96\xb8\xa8\xa0\xcb\x22\xb1\x55\x44\xd1\xee\x25\x1a\x9c\xa1\xb1\x98\x78\xbc\xe3\x49\x50\x16\xf1\xee\x2b\xd3\x06\xa5\xed\xc2\xfe\xf8\x2a\x1e\xcf\x39\x67\xe6\x64\xec\xb2\x2c\x0b\x88\xfe\x2b\x4a\xf2\x1c\xac\x81\x18\xd3\xbc\x3f\x29\x1e\x7d\xa8\xad\xb9\xc0\x48\x3c\xb4\x18\xb4\x68\x51\xa1\x06\x05\x5b\x18\x13\xa0\x45\x6b\x1c\x44\x28\x1d\x07\x15\x26\x42\x29\x5b\x08\xb0\x41\x29\x8c\x21\xb8\x47\x4a\x39\xd3\x98\x5d\x42\x19\x09\xc2\x07\xa0\x14\xd1\x65\x40\x42\x42\xa7\x2c\x5b\x70\x0b\xea\x9a\xeb\x09\xdb\x1f\xf3\x19\x23\x18\xc9\x3b\x48\xd6\x9c\x14\xc6\x28\xb6\x91\x40\x71\xc7\x3b\x69\x26\x2f\xda\x93\xf8\x0b\x11\x63\xc6\xc2\x5f\xbf\x51\x7a\xef\x70\xe1\x1c\x77\x41\x57\xbf\x71\x69\x14\x02\x1f\x50\x26\xe2\xa5\x01\xd9\x4c\xf6\xdb\x58\x59\x66\xd7\x53\x04\x87\x67\xcf\xcf\x66\xb6\x1a\x77\xe6\xe5\xe5\x28\x15\x28\x31\xf1\x46\x39\x69\x8d\x22\x47\xe7\xfd\xd9\xe9\x24\xe6\x5b\xd8\xa0\x35\xdf\x3b\x18\x66\x9e\xe7\xcd\x10\x51\x52\xe3\x1f\x74\xee\xa8\x4b\x8a\x52\x42\xf4\x65\x14\xee\x7d\x9d\x37\x4f\xc9\xb6\x90\xe3\x87\x1c\x55\x47\x54\x31\x79\x37\x58\xb3\xa0\x27\x18\xd2\x24\x63\x3b\x34\xfb\xed\xe7\x15\x59\xf4\xa8\xdb\x37\x5f\x2a\x16\xb5\xe6\xff\xd3\xd3\xff\xf6\x32\x46\xba\x06\x81\xb4\xf9\x71\x70\x16\x85\x95\x1d\x93\x35\xb7\xe7\xd5\xe4\x4c\x10\x6a\x1f\x30\xa5\x4a\xf8\x1e\xf7\x35\x1b\xd5\x78\x89\x6a\x0f\xa9\x40\x1b\x6b\xe6\x19\x39\x1c\xc9\xbc\xd6\x76\x5c\x02\xf9\x1e\xff\x49\xe5\x9d\x6e\xde\x91\xc1\xd0\x1f\xda\xb6\x35\x65\xf1\x6d\x7d\xb7\xfe\xbc\xb8\x59\x5e\xdc\x9d\xdf\x2c\x2f\x96\xab\xdb\xab\xc5\xf5\xfa\xee\xd3\xd5\xf5\xf2\x80\xba\x07\xea\x30\x0b\x73\x8b\xf3\x19\x3c\xa5\xb9\x13\xac\x31\xa8\x07\x9a\xfe\xbb\x9e\xa9\x6b\xf1\x4b\x9e\xea\xa3\x5f\xb5\x7b\x0c\x7e\x89\xcb\xab\xcd\xa8\x6a\xd7\xe0\xa8\x53\x4c\x79\xf7\x66\xff\x23\xba\x84\x4e\x0e\xcd\xdb\xc6\xb6\x77\xed\x6d\x44\x33\x7c\x04\x2a\x4a\xeb\x03\xa8\xe7\x70\x29\xe0\xb0\x42\xf1\x5c\xaf\xd1\x71\xa8\xf3\xe3\x30\x0e\x96\x32\xa1\xbc\xa6\xed\xd5\x83\x0f\x0f\xe8\xd4\x9a\x15\xaf\x5d\x83\x75\x47\x38\x91\x7f\xc4\xc1\x9a\xc0\x35\x96\xc2\x84\xb3\xc7\xee\x1e\x25\xa0\x62\xca\xf7\x68\x77\x47\x7e\x06\x00\x00\xff\xff\xf3\x15\x82\xb3\x62\x05\x00\x00") - -func capiCapaManagerDeploymentYamlBytes() ([]byte, error) { - return bindataRead( - _capiCapaManagerDeploymentYaml, - "capi/capa-manager-deployment.yaml", - ) -} - -func capiCapaManagerDeploymentYaml() (*asset, error) { - bytes, err := capiCapaManagerDeploymentYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/capa-manager-deployment.yaml", size: 1378, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x23, 0xd4, 0xb0, 0x50, 0x30, 0xe5, 0x5a, 0x57, 0xcd, 0x18, 0xba, 0x5c, 0x42, 0xce, 0x8b, 0x6, 0xcc, 0x79, 0xcb, 0xf9, 0x8e, 0xb1, 0x5e, 0xb8, 0xf2, 0x8a, 0x96, 0xd8, 0x90, 0xf0, 0x57}} - return a, nil -} - -var _capiCapaManagerServiceaccountYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\xb1\x0d\x03\x31\x08\x05\xd0\xde\x53\xb0\x80\x8b\xb4\x74\x99\x21\x52\xfa\x2f\x8c\x22\x14\x1b\x2c\x8e\xf3\xfc\xf7\xb0\xed\xab\x79\x59\x38\xd3\x79\xb5\xbf\xf9\x60\xfa\x68\x1e\x13\x7d\x8b\xc4\xed\xd5\x96\x16\x06\x0a\xdc\x88\x1c\x4b\x99\x04\x1b\x5d\xc2\x2b\x63\x4e\xcd\xbe\xe0\xf8\x69\x3e\x01\x00\x00\xff\xff\xfb\x85\xa6\xe2\x4d\x00\x00\x00") - -func capiCapaManagerServiceaccountYamlBytes() ([]byte, error) { - return bindataRead( - _capiCapaManagerServiceaccountYaml, - "capi/capa-manager-serviceaccount.yaml", - ) -} - -func capiCapaManagerServiceaccountYaml() (*asset, error) { - bytes, err := capiCapaManagerServiceaccountYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/capa-manager-serviceaccount.yaml", size: 77, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0x54, 0x7e, 0x1a, 0x44, 0x8f, 0xaf, 0xe, 0x93, 0x53, 0x41, 0x28, 0x8e, 0xb2, 0xf2, 0x46, 0x9a, 0x91, 0x50, 0xa4, 0x97, 0x76, 0x96, 0xee, 0x60, 0xea, 0x68, 0x5d, 0x19, 0x30, 0x15, 0xea}} - return a, nil -} - -var _capiManagerClusterroleYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x52\xb1\x8e\xdb\x30\x0c\xdd\xfd\x15\x42\x96\x00\x05\xec\xa0\x5b\xe1\xb5\x43\xf7\x0e\xdd\x19\x89\x8e\x85\xc8\xa4\x40\x52\x69\xda\xaf\x2f\xec\x38\x6d\x2f\xb1\x93\x3b\xdc\x4d\x96\xc9\xc7\xf7\xc8\x87\x07\x39\xfe\x40\xd1\xc8\xd4\x3a\xd9\x83\x6f\xa0\x58\xcf\x12\x7f\x83\x45\xa6\xe6\xf8\x45\x9b\xc8\xbb\xd3\xe7\xea\x18\x29\xb4\xee\x6b\x2a\x6a\x28\xdf\x39\x61\x35\xa0\x41\x00\x83\xb6\x72\x8e\x60\xc0\xd6\xf9\x4b\xb7\x86\x1c\x2b\x29\x09\xb5\xad\x6a\x07\x39\x7e\x13\x2e\x59\x47\xdc\xf4\x8b\x67\x43\x1a\x25\x75\xe6\xaf\x9c\x13\x54\x2e\xe2\x71\x46\xf9\xa2\xc6\xc3\xb5\x18\xb0\x8b\x14\xc7\x85\xb4\x72\xee\x84\xb2\x9f\x61\x07\xb4\xe9\x9b\xa2\x5e\x1e\x3f\xc1\x7c\x7f\x2f\xba\x67\x36\x35\x81\xdc\xcc\x2b\x36\xe7\xfa\xaf\x74\xed\x3c\x93\x09\xa7\x9c\x80\x70\x19\x11\xa9\x13\x50\x93\xe2\xad\xc8\x0a\x66\x00\xdf\x47\x42\x5d\xee\xe2\x39\x37\xaf\x61\x81\x10\x46\x63\x56\x39\x96\x0f\xb8\x2f\xde\x18\xba\xfd\xb4\x7d\x69\xdd\x58\xb8\xf3\xa9\xff\x95\x51\xb4\x8f\x9d\x35\x9c\x91\x2e\xaf\x25\xba\x9e\xd5\x30\xfc\xef\x9b\xae\xd5\x77\x6a\x60\x45\xe7\x03\x0c\x85\x20\x4d\x46\xcc\x4b\x3f\xe8\xfc\x1b\x7d\xb6\xf8\x66\xb3\x90\x21\xa6\x2e\x1e\x06\xc8\xcf\x42\x93\xa7\xd0\x3c\x88\xcf\x12\x3b\x9e\x90\xec\x86\xd9\x0b\x82\xe1\x07\x8a\x10\x07\x5c\xd7\x08\x98\xf0\xb9\x5c\xc9\xe1\x3a\xf0\x06\x65\x45\x2f\xf8\x9e\xfb\xfe\x04\x00\x00\xff\xff\x8a\x12\xad\x14\x59\x04\x00\x00") - -func capiManagerClusterroleYamlBytes() ([]byte, error) { - return bindataRead( - _capiManagerClusterroleYaml, - "capi/manager-clusterrole.yaml", - ) -} - -func capiManagerClusterroleYaml() (*asset, error) { - bytes, err := capiManagerClusterroleYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/manager-clusterrole.yaml", size: 1113, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7d, 0xe4, 0xc3, 0x70, 0xab, 0xae, 0x6f, 0xee, 0xa9, 0x21, 0xd2, 0x46, 0x1d, 0xc4, 0x90, 0xf6, 0xdd, 0x12, 0xfe, 0xe3, 0x3f, 0x1b, 0x43, 0x3f, 0xc5, 0x25, 0xb1, 0xd0, 0xf6, 0x33, 0x81, 0xba}} - return a, nil -} - -var _capiManagerClusterrolebindingYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8d\xb1\xae\xc2\x30\x0c\x45\xf7\x7c\x85\x7f\xa0\x79\x7a\x1b\xca\x06\x0c\x6c\x0c\x45\x62\x77\x53\x03\xa6\x6d\x1c\x25\x4e\x07\xaa\xfe\x3b\x42\x85\x89\x8a\xd1\xbe\xf7\xdc\x83\x91\xcf\x94\x32\x4b\x70\x90\x1a\xf4\x16\x8b\xde\x24\xf1\x03\x95\x25\xd8\x6e\x93\x2d\xcb\xdf\xf8\x6f\x3a\x0e\xad\x83\x7d\x5f\xb2\x52\xaa\xa5\xa7\x1d\x87\x96\xc3\xd5\x0c\xa4\xd8\xa2\xa2\x33\x00\x01\x07\x72\xe0\x97\x52\x85\x91\x4d\x92\x9e\x6a\xba\xbc\x42\x8c\x7c\x48\x52\xe2\x0f\x91\x01\xf8\xf2\xac\xce\xe6\xd2\xdc\xc9\x6b\x76\xa6\x7a\x13\x27\x4a\x23\x7b\xda\x7a\x2f\x25\xe8\x2a\xb4\xfc\x72\x44\x4f\x0e\xa6\x09\xec\xf1\x73\xc2\x3c\x9b\x67\x00\x00\x00\xff\xff\x1a\x7b\x6c\x93\x0a\x01\x00\x00") - -func capiManagerClusterrolebindingYamlBytes() ([]byte, error) { - return bindataRead( - _capiManagerClusterrolebindingYaml, - "capi/manager-clusterrolebinding.yaml", - ) -} - -func capiManagerClusterrolebindingYaml() (*asset, error) { - bytes, err := capiManagerClusterrolebindingYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/manager-clusterrolebinding.yaml", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb8, 0x27, 0x2, 0x83, 0x2c, 0x93, 0x57, 0x2, 0x8b, 0xb2, 0x1, 0x17, 0x59, 0xf5, 0x89, 0x5a, 0x53, 0x9d, 0x7b, 0xd6, 0xb2, 0xf6, 0x98, 0x5c, 0xd1, 0x5d, 0xff, 0x3c, 0xa4, 0x59, 0x40, 0x7d}} - return a, nil -} - -var _capiManagerDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xbb\x6e\xf3\x30\x0c\x85\x77\x3d\x05\x5f\xc0\x31\x02\xfc\x93\x80\x0c\x01\xfe\xb1\x08\x32\x75\x67\x69\xd6\x11\x4a\x5d\x2a\xd2\x29\x8c\x20\xef\x5e\xb8\xcd\xc5\x2e\xac\x49\xe2\x39\xe7\x3b\x14\x96\xf0\xca\x55\x43\x4e\x1e\xb0\x14\x6d\xcf\x5b\xf7\x11\x52\xe7\xe1\x3f\x17\xc9\x63\xe4\x64\x2e\xb2\x61\x87\x86\xde\x01\x24\x8c\xec\x81\x64\x50\xe3\xda\x60\x09\x4e\x0b\xd3\xa4\x54\x2e\x12\x08\xd5\xc3\xd6\x01\x28\x0b\x93\xe5\x3a\x29\x00\x11\x8d\x4e\x2f\xf8\xc6\xa2\xbf\x83\x35\x10\x80\x71\x2c\x82\xc6\xb7\xd0\xac\x76\x3a\xb2\xc8\xaf\x13\x00\xee\xeb\xfc\xdc\xb9\x9e\x03\xf1\x9e\x28\x0f\xc9\x0e\xab\x7e\x00\xca\xc9\x30\x24\xae\x0f\x76\x73\x63\x47\x4c\xd8\x73\x7d\x34\x86\x88\x3d\x7b\xf8\x1c\x70\xdc\x84\xdc\x9e\xc6\xc2\x55\x4f\xe1\xdd\xda\x19\xd5\x3f\xc7\xcb\xe0\x71\x10\x39\x66\x09\x34\x7a\xd8\xcb\x17\x8e\xfa\xd0\x29\xc7\x88\xa9\x7b\xfe\xad\x81\xf6\x6f\x39\xd6\x5e\xe7\x86\xa6\x99\x96\xd4\x82\xc4\xbb\xcb\x05\x36\x87\xfb\x0b\xae\xd7\x85\x0d\x45\xb3\xe4\xde\xb2\x5a\xc7\xb5\x2e\xb4\xf3\xee\x9f\xfb\x0e\x00\x00\xff\xff\x02\x65\x5c\xe9\x04\x02\x00\x00") - -func capiManagerDeploymentYamlBytes() ([]byte, error) { - return bindataRead( - _capiManagerDeploymentYaml, - "capi/manager-deployment.yaml", - ) -} - -func capiManagerDeploymentYaml() (*asset, error) { - bytes, err := capiManagerDeploymentYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/manager-deployment.yaml", size: 516, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0xe2, 0xdb, 0xed, 0xe7, 0x68, 0x5f, 0xa5, 0x61, 0x62, 0x6b, 0x41, 0x89, 0xb1, 0xaa, 0xf0, 0x2, 0x28, 0xc2, 0x45, 0x6d, 0xba, 0xef, 0x3c, 0xb8, 0xf3, 0x36, 0x5e, 0x51, 0xbf, 0xd7, 0x89}} - return a, nil -} - -var _capiManagerServiceaccountYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\x31\x0e\x80\x20\x0c\x05\xd0\xbd\xa7\xe8\x05\x1c\x5c\xbb\x79\x06\x13\xf7\xa6\xfc\xa1\x51\x0a\x81\xc2\xf9\x7d\xda\xfd\xc1\x98\xde\x42\x78\x9f\xf4\x7a\x14\xe1\x1b\x63\xbb\xe1\x32\x6b\x2b\x92\x2a\x52\x8b\xa6\x0a\x31\x87\x56\x08\xdb\xb7\x66\x62\x1c\xda\x9d\xfe\x00\x00\x00\xff\xff\x14\xfb\x48\x04\x42\x00\x00\x00") - -func capiManagerServiceaccountYamlBytes() ([]byte, error) { - return bindataRead( - _capiManagerServiceaccountYaml, - "capi/manager-serviceaccount.yaml", - ) -} - -func capiManagerServiceaccountYaml() (*asset, error) { - bytes, err := capiManagerServiceaccountYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "capi/manager-serviceaccount.yaml", size: 66, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0xd3, 0x3c, 0x7d, 0xa3, 0x26, 0x1e, 0x82, 0x92, 0x74, 0x79, 0x40, 0xca, 0x91, 0x9e, 0x73, 0x8d, 0x2a, 0xe9, 0x1a, 0xf7, 0xcb, 0xa3, 0x30, 0x3c, 0xdd, 0xaf, 0x7a, 0xca, 0xbb, 0x42, 0x55}} - return a, nil -} - var _clusterBootstrap00000_namespacesNeededForMonitoringYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x92\x31\x6e\xc3\x30\x0c\x45\x77\x9d\x82\xc8\xae\x14\x5d\x75\x88\x8e\xdd\x19\x99\xb5\x09\xcb\xa4\x40\x52\x29\x7a\xfb\x22\x43\xd1\x14\x9d\x0c\x7b\xff\x78\x7a\x7a\x60\xce\x39\x61\xe7\x77\x32\x67\x95\x02\xf7\xd7\xb4\xb2\x4c\x05\xde\x70\x23\xef\x58\x29\x6d\x14\x38\x61\x60\x49\x00\x82\x1b\x15\xd0\x4e\xe2\x0b\x7f\x44\xc6\xce\x4e\x76\x27\x4b\x07\x41\x55\x25\x4c\x5b\x23\xcb\x1b\x0a\xce\xc7\x89\xeb\xb8\xd1\x93\x1f\x40\xc3\x1b\x35\x7f\x4c\xe1\x77\x76\x65\x7d\xa9\x6d\x78\x3c\x1e\x56\xe1\x50\x63\x99\x0b\x5c\xc2\x06\x5d\x4e\x71\xf0\xba\xd0\x34\xda\x49\x3f\x3a\x3f\x14\x45\x9d\xf6\x32\x9e\x5b\x0a\xc5\xa7\xda\x7a\xfd\xd3\xb4\x6b\xe3\xfa\x95\x67\xd3\xd1\x0b\xb0\xcc\x46\xee\xbb\xd2\xff\x17\xfd\xa1\x1c\xbd\xd9\x11\x0b\x49\x70\xc5\x60\x95\xf4\x1d\x00\x00\xff\xff\x97\xb6\x41\xc5\x02\x03\x00\x00") func clusterBootstrap00000_namespacesNeededForMonitoringYamlBytes() ([]byte, error) { @@ -943,7 +774,7 @@ func hostedClusterConfigOperatorCpOperatorConfigmapYaml() (*asset, error) { return a, nil } -var _hostedClusterConfigOperatorCpOperatorDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\xcd\x6f\xe2\x38\x14\xbf\xf3\x57\x3c\x45\x73\xd8\x3d\x04\x66\xae\x96\x7a\x60\x21\xa3\x41\xd3\x52\x04\xed\x5c\x56\xab\xca\x75\x5e\xc0\xaa\x63\x67\x6c\x87\x96\x8d\xf8\xdf\x57\xce\x07\xb1\x43\x69\xb9\x6d\x4e\xe4\x7d\xfc\xde\xef\x7d\x06\x5a\xf0\x5f\xa8\x0d\x57\x92\x00\x2d\x0a\x33\xd9\x7f\x1b\xbd\x70\x99\x12\x98\x63\x21\xd4\x21\x47\x69\x47\x39\x5a\x9a\x52\x4b\xc9\x08\x40\xd2\x1c\x09\xec\x94\xb1\x98\xc6\x4c\x94\xc6\xa2\x8e\x99\x92\x19\xdf\xc6\xaa\x40\x4d\xad\xd2\x23\x53\x20\x73\xc6\x1a\x0b\xc1\x19\x35\x04\xbe\x8d\x00\x0c\x0a\x64\x56\x69\xa7\x01\xc8\xa9\x65\xbb\x5b\xfa\x8c\xc2\x34\x02\x70\x04\x3e\x85\x06\xb0\x98\x17\x82\x5a\x6c\x61\x3c\x6e\xee\x11\x01\xe2\xb5\x98\xcd\xd3\xea\x17\x73\x02\x51\x55\xc1\x78\xd6\xbd\xc3\xf1\x18\x8d\xaa\x0a\x78\x06\xe3\x35\x1a\x4b\xb5\x9d\x53\x8b\x70\x3c\x76\xcc\xa5\x54\x96\x5a\xae\xa4\x17\x5a\x15\x28\xcd\x8e\x67\x76\xcc\xd5\x44\x37\x6e\x98\x4e\x6d\x8b\x1e\x02\xd5\xf8\x28\xd3\x0e\xb3\x2b\x61\x8d\x9e\x65\x5c\x72\x7b\xe8\xa1\x0b\x95\x4e\xcf\x84\x00\x85\xc6\x0c\xb5\xc6\x74\x5e\x6a\x2e\xb7\x1b\xb6\xc3\xb4\x14\x5c\x6e\x17\x5b\xa9\x4e\xe2\xe4\x0d\x59\xe9\xb8\xfa\xae\x00\x31\xbc\x22\xdf\xee\x2c\x81\x6f\x5f\xbf\x06\x9a\x20\xde\x03\xea\x9c\x0c\xd4\x6d\xd9\x37\x41\x83\xc3\xa7\x6e\x77\xf2\x56\x68\x34\x26\x2c\x53\xc8\xe1\x05\x0f\xa4\x6f\xc4\xbb\x46\x75\x65\xeb\xce\x11\x58\xc8\x0b\x26\x7b\x2a\x4a\x34\x04\xfe\x3e\xef\xe4\x3f\x67\x2e\x56\x15\x4a\xa8\xed\xe1\xa7\x0b\x1e\xbd\x94\xcf\xa8\x25\x5a\x34\xae\x71\x6e\x76\xdc\xd0\x47\xa3\xce\x56\xb8\xe0\x61\x0e\x2d\xef\x28\x2f\x85\xe5\x31\xfd\x37\x7e\x55\xfa\x05\x75\x34\x7a\x8f\x73\x94\xfc\x2e\xa9\xf0\x75\x35\x59\x02\x91\xd5\x25\xfa\x72\xcc\x32\x64\x96\xc0\x52\xb5\xad\xc4\x6e\x0a\xef\xa8\xcb\x67\xa5\xb9\xd2\xdc\x1e\x66\x82\x1a\xd3\x4f\x63\xe1\x8b\x97\xf5\xc2\xba\x22\x5c\xf0\x09\xe7\x0e\x80\x29\x69\x29\x97\xa8\x4f\xf9\xc5\xc0\x73\xba\x6d\x51\x7e\xd4\xbb\xd4\x16\x74\x56\x6f\xd2\x7d\x9b\xda\xc2\x59\xf5\x40\x57\x1e\x8b\x36\xa3\x0f\x70\x37\xc8\x4a\x47\xd9\x87\x36\xad\x6c\xa6\xa4\xc5\x37\xeb\x8f\x93\x2e\xe5\xd4\x3c\x1a\xd4\x9f\x12\xf6\x81\x87\x65\x00\x40\xb9\xf7\x3b\xdc\x24\xb3\xba\x9f\x3f\x2d\xa7\x77\xc9\x66\x35\x9d\x25\xc3\x16\x7e\xd7\x6a\xb0\x1b\x19\x47\x91\xae\x31\x1b\x8e\x7b\x2d\x5f\x51\xbb\x23\xa7\x0b\x36\x76\x01\x4c\x41\x19\x9e\x05\xbd\x5f\x25\xcb\xcd\x8f\xc5\xf7\x87\xa7\x75\x72\x9b\x4c\x37\xc9\xd3\xaf\x64\xbd\x59\xdc\x2f\xcf\x67\xa8\xaa\x60\xdf\x1c\x74\x88\x34\x0a\xa4\x06\x23\x3f\xa9\x0e\xf2\xe7\xe3\x5f\xc9\x7a\x99\x3c\x24\x9b\xeb\xb0\xfa\xa5\x08\xe0\x98\xca\x73\x2a\x53\xbf\x4e\xd1\xa4\x34\x7a\xf2\xcc\xe5\xe4\xe3\xc6\x47\xbe\x4f\x1c\xbb\xe3\xc2\xa9\x88\x19\x8d\x33\x2e\xf0\x66\x82\x96\x4d\xfa\xa8\x93\xc6\x7b\xd2\x9b\x8d\x99\xb6\x03\x0c\x4b\xf5\x16\x6d\xec\xbc\x1a\xf3\x33\x94\x5e\xe5\xfd\x1c\xa0\x9c\xfa\x10\xc8\xbf\xfc\x11\xb4\xfe\xcf\xa8\xaa\x34\x95\x5b\x84\x2f\x6e\x61\xb4\x12\x02\x35\x90\x9b\x0f\xe7\x6d\x76\xb2\x34\x61\x4f\xa2\x38\xee\x51\xcc\x4d\x55\x79\xa0\xc7\x63\x54\x55\x28\xd3\x66\x46\x3f\x59\x95\x35\x1a\x55\x6a\x86\x01\xbe\xee\x84\xa4\xaa\xa0\x21\x7d\x2d\x46\xef\xd0\x49\xd7\xf8\xbb\x44\x63\x7d\x7c\x17\xa1\x16\x9a\x7a\x66\x1c\xc5\xd9\xea\x31\xb4\x00\x60\x45\xd9\x2c\x64\xa3\x3b\xed\x5b\x77\xd1\x30\x57\xfa\x30\x74\xca\x6b\x69\x7b\xbf\x3a\x0b\xdf\xf5\xf4\x63\x40\xf3\x96\xe7\x7c\x40\x52\x38\xd1\xff\x49\xb1\xbd\x2f\xe7\x97\x66\xaf\x44\x99\xe3\x9d\x2a\xa5\x0d\x3e\x2a\xb9\x93\x34\x57\xe2\xf2\x20\x7b\x64\x9a\xd5\x7e\x47\xf5\x21\xd4\x05\x98\x40\xdc\xfe\x7d\x59\x29\xc1\xd9\x81\xc0\x54\xbc\xd2\x83\x69\x75\x06\xf5\x9e\x33\x9c\x32\xe6\x62\x2c\xaf\xb9\xf9\x7e\xda\xde\x67\xe6\x22\x7f\x83\x4c\x63\x70\xe4\x1b\x49\x13\xac\x25\x10\x4b\xb4\xee\xbb\x1b\xd3\x34\xe7\x32\x3e\x83\x89\xdf\x4b\x0c\xda\xd7\x3b\x5a\x90\xb3\x12\x7c\x92\xc5\x7f\x01\x00\x00\xff\xff\x8e\x42\xbd\xb8\x3d\x0b\x00\x00") +var _hostedClusterConfigOperatorCpOperatorDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\x4b\x6f\xe2\x48\x10\xbe\xf3\x2b\x4a\xd6\x1c\x76\x0f\x86\xc9\xd5\x52\x0e\x2c\x71\x34\x68\x12\x82\x20\x99\xcb\x6a\x15\x75\xda\x65\x68\xa5\xdd\xed\xa9\x6e\x93\xb0\x16\xff\x7d\xd5\x7e\x60\xb7\x09\x09\xb7\xf5\xc9\xd4\xe3\xab\xaf\x9e\x86\xe5\xe2\x17\x92\x11\x5a\x45\xc0\xf2\xdc\x4c\x76\x57\xa3\x57\xa1\x92\x08\x6e\x30\x97\x7a\x9f\xa1\xb2\xa3\x0c\x2d\x4b\x98\x65\xd1\x08\x40\xb1\x0c\x23\xd8\x6a\x63\x31\x09\xb9\x2c\x8c\x45\x0a\xb9\x56\xa9\xd8\x84\x3a\x47\x62\x56\xd3\xc8\xe4\xc8\x9d\x31\x61\x2e\x05\x67\x26\x82\xab\x11\x80\x41\x89\xdc\x6a\x72\x1a\x80\x8c\x59\xbe\xbd\x63\x2f\x28\x4d\x2d\x00\x47\xe0\x4b\x68\x00\x8b\x59\x2e\x99\xc5\x06\xa6\xc7\xcd\x3d\xd2\x43\xbc\x14\xb3\x7e\x1a\xfd\xfc\x26\x82\xa0\x2c\x61\x3c\x6b\x7f\xc3\xe1\x10\x8c\xca\x12\x44\x0a\xe3\x15\x1a\xcb\xc8\xde\x30\x8b\x70\x38\xb4\xcc\x95\xd2\x96\x59\xa1\x55\x2f\xb4\xce\x51\x99\xad\x48\xed\x58\xe8\x09\xd5\x6e\x98\x4c\x6d\x83\xee\x03\x55\xf8\xa8\x92\x16\xb3\x2d\x61\x85\x9e\xa6\x42\x09\xbb\xef\xa0\x73\x9d\x4c\x4f\x84\x00\x39\x61\x8a\x44\x98\xdc\x14\x24\xd4\x66\xcd\xb7\x98\x14\x52\xa8\xcd\x7c\xa3\xf4\x51\x1c\xbf\x23\x2f\x1c\xd7\xbe\x2b\x40\x08\x6f\x28\x36\x5b\x1b\xc1\xd5\xf7\xef\x9e\xc6\x8b\xf7\x88\x94\x45\x03\x75\x53\xf6\xb5\xd7\x60\xff\xa9\xda\x1d\xbf\xe7\x84\xc6\xf8\x65\xf2\x39\xbc\xe2\x3e\xea\x1a\xf1\xa1\x51\x55\xd9\xaa\x73\x11\xcc\xd5\x19\x93\x1d\x93\x05\x9a\x08\xfe\x3e\xed\xe4\x3f\x27\x2e\x56\xe7\x5a\xea\xcd\xfe\xa7\x0b\x1e\xbc\x16\x2f\x48\x0a\x2d\x1a\xd7\x38\x37\x3b\x6e\xe8\x83\x51\x6b\x2b\x5d\x70\x3f\x87\x86\x77\x90\x15\xd2\x8a\x90\xfd\x1b\xbe\x69\x7a\x45\x0a\x46\x1f\x71\x0e\xe2\xdf\x05\x93\x7d\x5d\x45\x36\x82\xc0\x52\x81\x7d\x39\xa6\x29\x72\x1b\xc1\x42\x37\xad\xc4\x76\x0a\xef\x99\xcb\x67\x49\x42\x93\xb0\xfb\x99\x64\xc6\x74\xd3\x98\xf7\xc5\x8b\x6a\x61\x5d\x11\xce\xf8\xf8\x73\x07\xc0\xb5\xb2\x4c\x28\xa4\x63\x7e\x21\x88\x8c\x6d\x6a\x94\xea\xed\x56\x13\x04\x9f\x2f\x55\xd0\x01\x5e\x78\x34\x9a\xcc\x7e\x54\x56\x4d\xc3\x66\x95\xcd\x43\x63\xb2\x46\x5e\x38\xea\x7d\x68\xd3\xc8\x66\x5a\x59\x7c\xb7\xfd\xb1\xa2\x42\x4d\xcd\x93\x41\xaa\xd3\xbf\x10\x78\x58\x0e\x00\x54\xbb\x7e\xa7\xeb\x64\x96\x0f\x37\xcf\x8b\xe9\x7d\xbc\x5e\x4e\x67\xf1\xb0\x95\xb7\xa4\x07\x3b\x92\x0a\x94\xc9\x0a\xd3\xe1\xd8\x57\xf2\x25\xb3\xdb\xe8\x78\xc9\xc6\x2e\x80\xc9\x19\xc7\x93\xa0\x0f\xcb\x78\xb1\xfe\x31\xbf\x7d\x7c\x5e\xc5\x77\xf1\x74\x1d\x3f\xff\x8a\x57\xeb\xf9\xc3\xe2\x74\x96\xca\x12\x76\xf5\x61\x87\x80\x50\x22\x33\xe8\xb5\xa4\x85\xfc\xf9\xf4\x57\xbc\x5a\xc4\x8f\xf1\xfa\x32\xac\x6e\x39\x3c\x38\xae\xb3\x8c\xa9\xa4\x5f\xa7\x60\x52\x18\x9a\xbc\x08\x35\xf9\x62\x52\xfa\x3e\x61\xe8\x8e\x8c\x60\x32\xe4\x2c\x4c\x85\xc4\xeb\x09\x5a\x3e\xe9\xa2\x4e\x6a\xef\x49\x67\x36\xe6\x64\x07\x18\x96\xd1\x06\x6d\xe8\xbc\x6a\xf3\x13\x94\x4e\xd5\x7b\x1d\xa0\x1c\xfb\xe0\xc9\xbf\xfd\xe1\xb5\xfe\xcf\xa0\x2c\x89\xa9\x0d\xc2\x37\xb7\x38\xa4\xa5\x44\x82\xe8\xfa\xd3\x79\x9b\x1d\x2d\x8d\xdf\x93\x20\x0c\x3b\x14\x73\x5d\x96\x3d\xd0\xc3\x21\x28\x4b\x54\x49\x3d\xa3\x5f\xac\xca\x0a\x8d\x2e\x88\xa3\x87\x4f\xad\x30\x2a\x4b\xa8\x49\x5f\x8a\xd1\x39\xb4\xd2\x15\xfe\x2e\xd0\xd8\x3e\xbe\x8b\x50\x09\x4d\x7d\x2a\x52\x18\xcf\x96\x4f\xbe\x05\x00\xcf\x8b\x7a\x21\x6b\xdd\x71\xdf\xda\xcb\x86\x99\xa6\xfd\xd0\x29\xab\xa4\xcd\x1d\x6b\x2d\xfa\xae\xc7\x97\x01\xcd\x3b\x91\x89\x01\x49\xe9\x44\xff\x27\xc5\xe6\xbe\x9c\x5e\x9a\x9d\x96\x45\x86\xf7\xba\x50\xd6\xfb\xb8\x64\x4e\x52\x5f\x89\xf3\x83\xdc\x23\x53\xaf\xf6\x07\xaa\x4f\xa1\xce\xc0\x78\xe2\xe6\x6f\xcc\x52\x4b\xc1\xf7\x11\x4c\xe5\x1b\xdb\x9b\x46\x67\x90\x76\x82\xe3\x94\x73\x17\x63\x71\xc9\xcd\xef\xa7\xdd\xfb\xdc\x9c\xe5\x6f\x90\x13\x7a\x47\xbe\x96\xd4\xc1\x1a\x02\xa1\x42\xeb\xbe\xbf\x21\x4b\x32\xa1\xc2\x13\x98\xf0\xa3\xc4\xa0\xf9\x79\xcf\xf2\xe8\xa4\x04\x5f\x64\xf1\x5f\x00\x00\x00\xff\xff\xd1\xff\x7f\x05\x45\x0b\x00\x00") func hostedClusterConfigOperatorCpOperatorDeploymentYamlBytes() ([]byte, error) { return bindataRead( @@ -958,8 +789,8 @@ func hostedClusterConfigOperatorCpOperatorDeploymentYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "hosted-cluster-config-operator/cp-operator-deployment.yaml", size: 2877, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x89, 0x52, 0x6e, 0x71, 0x1c, 0x11, 0x94, 0xcf, 0x59, 0x97, 0x56, 0xd0, 0xac, 0xb, 0xe, 0xc, 0x94, 0x46, 0x8e, 0x1f, 0x7c, 0x65, 0x33, 0x94, 0x7a, 0xa1, 0xa9, 0x4a, 0x57, 0x60, 0x54, 0x32}} + info := bindataFileInfo{name: "hosted-cluster-config-operator/cp-operator-deployment.yaml", size: 2885, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xa0, 0xe5, 0xae, 0x24, 0xf0, 0xa7, 0x85, 0xdb, 0x55, 0x8b, 0xbb, 0x81, 0xf, 0xd9, 0xe8, 0x0, 0xe1, 0x33, 0xd4, 0xa4, 0xfd, 0xc7, 0xa5, 0xac, 0xc2, 0xcc, 0x9, 0x7b, 0xfe, 0x6d, 0xce}} return a, nil } @@ -1023,26 +854,6 @@ func hostedClusterConfigOperatorCpOperatorServiceaccountYaml() (*asset, error) { return a, nil } -var _hypershiftOperatorHypershiftOperatorConfigmapYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x34\xca\xb1\x0a\xc2\x30\x10\x06\xe0\x3d\x4f\xf1\xd3\xbd\x82\xe0\x94\xd5\xd9\xd5\x55\xce\xe4\x6a\x7f\xda\x5e\x42\x7a\x0a\x52\xfb\xee\x2e\xba\x7f\x52\x79\xd5\xb6\xb2\x58\xc4\xeb\x18\x26\x5a\x8e\x38\x17\x1b\xf8\xb8\x48\x0d\x8b\xba\x64\x71\x89\x01\x30\x59\x34\x62\x7c\x57\x6d\xeb\xc8\xc1\xfb\x52\xb5\x89\x97\x16\xfe\x82\x46\xa7\xcc\x7d\x92\x43\x6a\x1e\xf1\x09\xdb\x06\x5a\x9a\x9f\x59\x6f\x75\x22\xba\x54\x96\x3b\x4d\xf3\x8f\x74\xc0\x09\xfb\x1e\xbe\x01\x00\x00\xff\xff\x97\x3f\xba\x1f\x86\x00\x00\x00") - -func hypershiftOperatorHypershiftOperatorConfigmapYamlBytes() ([]byte, error) { - return bindataRead( - _hypershiftOperatorHypershiftOperatorConfigmapYaml, - "hypershift-operator/hypershift-operator-configmap.yaml", - ) -} - -func hypershiftOperatorHypershiftOperatorConfigmapYaml() (*asset, error) { - bytes, err := hypershiftOperatorHypershiftOperatorConfigmapYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "hypershift-operator/hypershift-operator-configmap.yaml", size: 134, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x37, 0xc6, 0x61, 0x4f, 0x9f, 0xeb, 0xe5, 0x7b, 0xd7, 0x43, 0xe7, 0x24, 0xec, 0xdb, 0x12, 0x1a, 0xce, 0x8f, 0xc6, 0x4b, 0x56, 0x0, 0xe0, 0x70, 0x27, 0xc1, 0x43, 0xbb, 0xf1, 0x88, 0x28, 0x89}} - return a, nil -} - var _ignitionConfigs20ApiserverHaproxyYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x94\x41\x8f\x9c\x30\x0c\x85\xef\xfc\x0a\x8b\x3b\x30\x3b\xda\x6d\xa5\x5c\xab\xde\xda\x4b\xa5\xf6\xee\x09\x66\xb0\x36\x38\x28\x31\xb4\x23\x3a\xff\xbd\x82\xec\xb0\xb4\xdd\x91\xda\xd1\xee\x31\x8e\xfd\xde\xfb\xac\x00\xf6\xfc\x8d\x42\x64\x2f\x06\x3a\xb4\x2d\x0b\x59\x2f\x0d\x1f\x87\x80\xca\x5e\x4a\xdf\x93\xc4\x96\x1b\x2d\xd9\x57\xe3\x5d\xf6\xc8\x52\x1b\xf8\x9c\x5a\x3f\x2c\xad\x59\x47\x8a\x35\x2a\x9a\x0c\x40\xb0\x23\x03\xfb\x5d\x81\x3d\x47\x0a\x23\x85\xa2\xc5\x3e\xf8\x1f\xa7\x0c\xc0\xe1\x81\x5c\x9c\xdb\xe0\x1f\xdc\x82\x77\x34\xa7\x8a\x4a\x21\x8b\x3d\xd9\x79\x30\xf5\x27\x09\x3e\x0a\xcf\x63\xe9\x04\x30\x5e\x48\xf6\xe5\xbe\xdc\x2d\xc5\xa8\x3e\xe0\x91\x2e\x1d\x0d\x3b\x8a\x97\x43\x91\x8e\xa7\xa8\xd4\x19\x08\xde\xeb\xd3\x05\x40\x8f\xda\x1a\xc8\xab\x21\x86\xca\x79\x8b\xae\x3a\xb0\x54\x91\x74\xe8\x37\x60\xdc\x97\xb1\xcd\xd7\x21\xeb\x45\x49\x74\xd5\x5f\xfc\xfd\x10\x2c\x19\xc8\xa7\x09\xe6\x15\x7d\xfd\xf2\xe9\xa3\x58\x5f\x13\xe4\x7f\x2d\xe8\x8a\x3e\x9c\xcf\xf9\x46\x71\xa4\xc0\x0d\xdb\x65\x5f\x06\xa6\xf3\x7a\xd5\xf9\x9a\x0c\xec\xde\x3f\x3c\xdc\xca\xa7\x84\xa1\xf6\xdf\xe5\x0d\x11\xaf\x5a\xbc\x25\x25\xa9\xad\x1e\x87\x03\x05\x21\xa5\x58\x3d\x5b\x2f\x99\x8a\xf4\xa4\xaa\xa7\x88\xa5\x6d\x8e\xaf\x08\xbc\x55\xfd\x4f\xc6\x77\xf7\xf7\x37\x33\x76\x28\xdc\x50\xd4\xb8\x14\x8b\x3f\x90\xcb\x13\x76\xee\x15\x21\xaf\x7b\xdc\x88\x9c\x50\xeb\x4b\xa0\x41\x58\x37\x9f\xed\x9a\x17\x7e\x16\xd9\x34\x01\x8b\x75\xc3\xcb\xc9\x7e\x7f\x66\x14\x46\xb6\x94\xc3\xdd\x0e\xce\xcf\xde\x24\x78\x70\x54\x1b\xd0\x30\xd0\x5a\x4d\x3f\xb2\xfc\x45\x81\xec\x57\x00\x00\x00\xff\xff\xcc\x34\xb4\x8f\x37\x05\x00\x00") func ignitionConfigs20ApiserverHaproxyYamlBytes() ([]byte, error) { @@ -3419,14 +3230,6 @@ var _bindata = map[string]func() (*asset, error){ "apiserver-haproxy/kube-apiserver-proxy.yaml": apiserverHaproxyKubeApiserverProxyYaml, "apiserver-haproxy/setup-apiserver-ip.sh": apiserverHaproxySetupApiserverIpSh, "apiserver-haproxy/teardown-apiserver-ip.sh": apiserverHaproxyTeardownApiserverIpSh, - "capi/capa-manager-clusterrole.yaml": capiCapaManagerClusterroleYaml, - "capi/capa-manager-clusterrolebinding.yaml": capiCapaManagerClusterrolebindingYaml, - "capi/capa-manager-deployment.yaml": capiCapaManagerDeploymentYaml, - "capi/capa-manager-serviceaccount.yaml": capiCapaManagerServiceaccountYaml, - "capi/manager-clusterrole.yaml": capiManagerClusterroleYaml, - "capi/manager-clusterrolebinding.yaml": capiManagerClusterrolebindingYaml, - "capi/manager-deployment.yaml": capiManagerDeploymentYaml, - "capi/manager-serviceaccount.yaml": capiManagerServiceaccountYaml, "cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml": clusterBootstrap00000_namespacesNeededForMonitoringYaml, "cluster-bootstrap/cluster-config-v1-configmap.yaml": clusterBootstrapClusterConfigV1ConfigmapYaml, "cluster-bootstrap/cluster-dns-02-config.yaml": clusterBootstrapClusterDns02ConfigYaml, @@ -3454,7 +3257,6 @@ var _bindata = map[string]func() (*asset, error){ "hosted-cluster-config-operator/cp-operator-role.yaml": hostedClusterConfigOperatorCpOperatorRoleYaml, "hosted-cluster-config-operator/cp-operator-rolebinding.yaml": hostedClusterConfigOperatorCpOperatorRolebindingYaml, "hosted-cluster-config-operator/cp-operator-serviceaccount.yaml": hostedClusterConfigOperatorCpOperatorServiceaccountYaml, - "hypershift-operator/hypershift-operator-configmap.yaml": hypershiftOperatorHypershiftOperatorConfigmapYaml, "ignition-configs/20-apiserver-haproxy.yaml": ignitionConfigs20ApiserverHaproxyYaml, "ignition-configs/99-worker-ssh.yaml": ignitionConfigs99WorkerSshYaml, "kube-apiserver/client.conf": kubeApiserverClientConf, @@ -3622,16 +3424,6 @@ var _bintree = &bintree{nil, map[string]*bintree{ "setup-apiserver-ip.sh": {apiserverHaproxySetupApiserverIpSh, map[string]*bintree{}}, "teardown-apiserver-ip.sh": {apiserverHaproxyTeardownApiserverIpSh, map[string]*bintree{}}, }}, - "capi": {nil, map[string]*bintree{ - "capa-manager-clusterrole.yaml": {capiCapaManagerClusterroleYaml, map[string]*bintree{}}, - "capa-manager-clusterrolebinding.yaml": {capiCapaManagerClusterrolebindingYaml, map[string]*bintree{}}, - "capa-manager-deployment.yaml": {capiCapaManagerDeploymentYaml, map[string]*bintree{}}, - "capa-manager-serviceaccount.yaml": {capiCapaManagerServiceaccountYaml, map[string]*bintree{}}, - "manager-clusterrole.yaml": {capiManagerClusterroleYaml, map[string]*bintree{}}, - "manager-clusterrolebinding.yaml": {capiManagerClusterrolebindingYaml, map[string]*bintree{}}, - "manager-deployment.yaml": {capiManagerDeploymentYaml, map[string]*bintree{}}, - "manager-serviceaccount.yaml": {capiManagerServiceaccountYaml, map[string]*bintree{}}, - }}, "cluster-bootstrap": {nil, map[string]*bintree{ "00000_namespaces-needed-for-monitoring.yaml": {clusterBootstrap00000_namespacesNeededForMonitoringYaml, map[string]*bintree{}}, "cluster-config-v1-configmap.yaml": {clusterBootstrapClusterConfigV1ConfigmapYaml, map[string]*bintree{}}, @@ -3669,9 +3461,6 @@ var _bintree = &bintree{nil, map[string]*bintree{ "cp-operator-rolebinding.yaml": {hostedClusterConfigOperatorCpOperatorRolebindingYaml, map[string]*bintree{}}, "cp-operator-serviceaccount.yaml": {hostedClusterConfigOperatorCpOperatorServiceaccountYaml, map[string]*bintree{}}, }}, - "hypershift-operator": {nil, map[string]*bintree{ - "hypershift-operator-configmap.yaml": {hypershiftOperatorHypershiftOperatorConfigmapYaml, map[string]*bintree{}}, - }}, "ignition-configs": {nil, map[string]*bintree{ "20-apiserver-haproxy.yaml": {ignitionConfigs20ApiserverHaproxyYaml, map[string]*bintree{}}, "99-worker-ssh.yaml": {ignitionConfigs99WorkerSshYaml, map[string]*bintree{}}, diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/00000_namespaces-needed-for-monitoring.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-config-v1-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-config-v1-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-config-v1-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-config-v1-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-dns-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-dns-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-dns-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-dns-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-infrastructure-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-infrastructure-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-infrastructure-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-infrastructure-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-ingress-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-ingress-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-ingress-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-ingress-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-kube-apiserver-servicemonitor.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-01-crd.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-01-crd.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-01-crd.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-01-crd.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-network-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-network-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-proxy-01-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-proxy-01-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-proxy-01-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-proxy-01-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-version-namespace.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-version-namespace.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/cluster-version-namespace.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/cluster-version-namespace.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrole.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/namespace-security-allocation-controller-clusterrolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-bootstrap/node-bootstrapper-clusterrolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/cluster-version-operator/cluster-version-operator-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/cluster-version-operator/cluster-version-operator-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/cluster-version-operator/cluster-version-operator-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/cluster-version-operator/cluster-version-operator-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/common/service-network-admin-kubeconfig-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/common/service-network-admin-kubeconfig-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/common/service-network-admin-kubeconfig-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/common/service-network-admin-kubeconfig-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster-crd.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster-crd.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster-crd.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster-crd.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-cluster.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-cluster.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role-binding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role-binding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role-binding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role-binding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-cluster-role.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-cluster-role.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-operator.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-operator.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/etcd/etcd-secret-template.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-secret-template.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/etcd/etcd-secret-template.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/etcd/etcd-secret-template.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-deployment.yaml similarity index 97% rename from hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-deployment.yaml index c10c4bbb94d9..1291ab283716 100644 --- a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-deployment.yaml @@ -37,7 +37,7 @@ spec: priorityClassName: {{ .MasterPriorityClass }} {{ end }} containers: - - image: {{ .HostedClusterConfigOperatorImage }} + - image: {{ imageFor "hosted-cluster-config-operator" }} name: hosted-cluster-config-operator {{ if .HostedClusterConfigOperatorSecurity }} securityContext: diff --git a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-role.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-role.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-role.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-role.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-rolebinding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-rolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-rolebinding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-rolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/hosted-cluster-config-operator/cp-operator-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/ignition-configs/20-apiserver-haproxy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/20-apiserver-haproxy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/ignition-configs/20-apiserver-haproxy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/20-apiserver-haproxy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/ignition-configs/99-worker-ssh.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/99-worker-ssh.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/ignition-configs/99-worker-ssh.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/ignition-configs/99-worker-ssh.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/client.conf b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/client.conf similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/client.conf rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/client.conf diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/default-audit-policy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/default-audit-policy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/default-audit-policy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/default-audit-policy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-default-audit-policy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-default-audit-policy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-default-audit-policy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-default-audit-policy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment-patch.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment-patch.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment-patch.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment-patch.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-localhost-kubeconfig-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-oauth-metadata-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/kube-apiserver-vpnclient-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/kube-apiserver-vpnclient-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-apiserver/oauthMetadata.json b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/oauthMetadata.json similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-apiserver/oauthMetadata.json rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-apiserver/oauthMetadata.json diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-controller-manager/kube-controller-manager-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-controller-manager/kube-controller-manager-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-scheduler/config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-scheduler/config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/kube-scheduler/kube-scheduler-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/kube-scheduler/kube-scheduler-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-dns-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-dns-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-dns-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-dns-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-infrastructure-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-infrastructure-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-infrastructure-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-infrastructure-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-network-02-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-network-02-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-network-02-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-network-02-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-proxy-01-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-proxy-01-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/cluster-proxy-01-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/cluster-proxy-01-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/install-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/install-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/install-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/install-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-kubeconfig-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-kubeconfig-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-kubeconfig-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-kubeconfig-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-rolebinding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-rolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-rolebinding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-rolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/machine-config-server-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/machine-config-server-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/master.machineconfigpool.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/master.machineconfigpool.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/master.machineconfigpool.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/master.machineconfigpool.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/pull-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/pull-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/pull-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/pull-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/machine-config-server/worker.machineconfigpool.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/worker.machineconfigpool.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/machine-config-server/worker.machineconfigpool.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/machine-config-server/worker.machineconfigpool.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/audit-policy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/audit-policy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/audit-policy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/audit-policy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-auditpolicy.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-auditpolicy.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-auditpolicy.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-auditpolicy.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-endpoint.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-endpoint.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-endpoint.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-endpoint.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/oauth-apiserver-user-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/oauth-apiserver-user-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/service-template.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/service-template.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-apiserver/service-template.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-apiserver/service-template.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/ingress-certs-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/ingress-certs-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/ingress-certs-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/ingress-certs-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-browser-client.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-browser-client.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-browser-client.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-browser-client.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-challenging-client.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-challenging-client.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-challenging-client.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-challenging-client.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-sessionsecret-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-sessionsecret-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/oauth-server-sessionsecret-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/oauth-server-sessionsecret-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-branding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-branding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-branding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-branding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-session.json b/control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-session.json similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/oauth-openshift/v4-0-config-system-session.json rename to control-plane-operator/controllers/hostedcontrolplane/assets/oauth-openshift/v4-0-config-system-session.json diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-endpoint.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-endpoint.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-endpoint.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-endpoint.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/openshift-apiserver-user-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/openshift-apiserver-user-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/service-template.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/service-template.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-apiserver/service-template.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-apiserver/service-template.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/00-openshift-controller-manager-namespace.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/cluster-policy-controller-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/cluster-policy-controller-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/cluster-policy-controller-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/cluster-policy-controller-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-config-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-service-ca.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-service-ca.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openshift-controller-manager/openshift-controller-manager-service-ca.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openshift-controller-manager/openshift-controller-manager-service-ca.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/Dockerfile b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/Dockerfile similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/Dockerfile rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/Dockerfile diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/client.conf b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/client.conf similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/client.conf rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/client.conf diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-ccd-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-ccd-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-ccd-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-ccd-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-client-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-client-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-server-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-server-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/openvpn-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/openvpn-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/server.conf b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/server.conf similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/server.conf rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/server.conf diff --git a/hypershift-operator/assets/controlplane/hypershift/openvpn/worker b/control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/worker similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/openvpn/worker rename to control-plane-operator/controllers/hostedcontrolplane/assets/openvpn/worker diff --git a/hypershift-operator/assets/controlplane/hypershift/registry/cluster-imageregistry-config.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/registry/cluster-imageregistry-config.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/registry/cluster-imageregistry-config.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/registry/cluster-imageregistry-config.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-00-namespace.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-00-namespace.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-00-namespace.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-00-namespace.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-push-gateway-servicemonitor.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-rbac.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-rbac.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-rbac.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-rbac.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-servicemonitor.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-servicemonitor.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/roks-metrics/roks-metrics-servicemonitor.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/roks-metrics/roks-metrics-servicemonitor.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/client.conf b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/client.conf similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/client.conf rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/client.conf diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/haproxy.cfg b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/haproxy.cfg similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/haproxy.cfg rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/haproxy.cfg diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-deployment.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-http-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-http-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-http-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-http-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-https-service.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-https-service.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-https-service.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-https-service.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-configmap.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-configmap.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-configmap.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-configmap.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-secret.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-secret.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/router-proxy/router-proxy-vpnclient-secret.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/router-proxy/router-proxy-vpnclient-secret.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifest-template.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifest-template.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifest-template.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifest-template.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-pod.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-rolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml b/control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml rename to control-plane-operator/controllers/hostedcontrolplane/assets/user-manifests-bootstrapper/user-manifests-bootstrapper-serviceaccount.yaml diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go new file mode 100644 index 000000000000..f77b2b4d991c --- /dev/null +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -0,0 +1,982 @@ +package hostedcontrolplane + +import ( + "bytes" + "context" + crand "crypto/rand" + "encoding/base64" + "encoding/hex" + "fmt" + "math/big" + "math/rand" + "strings" + "time" + + "github.com/blang/semver" + "github.com/go-logr/logr" + configv1 "github.com/openshift/api/config/v1" + operatorv1 "github.com/openshift/api/operator/v1" + routev1 "github.com/openshift/api/route/v1" + securityv1 "github.com/openshift/api/security/v1" + + "golang.org/x/crypto/bcrypt" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/yaml" + "k8s.io/client-go/tools/record" + "k8s.io/client-go/util/workqueue" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/patch" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + + hyperv1 "openshift.io/hypershift/api/v1alpha1" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/render" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/render/pki" + "openshift.io/hypershift/control-plane-operator/releaseinfo" +) + +const ( + finalizer = "hypershift.openshift.io/finalizer" + APIServerPort = 6443 + kubeAPIServerServiceName = "kube-apiserver" + vpnServiceName = "openvpn-server" + oauthServiceName = "oauth-openshift" + pullSecretName = "pull-secret" + vpnServiceAccountName = "vpn" + ingressOperatorNamespace = "openshift-ingress-operator" + hypershiftRouteLabel = "hypershift.openshift.io/cluster" + oauthBrandingManifest = "v4-0-config-system-branding.yaml" + DefaultAPIServerIPAddress = "172.20.0.1" + externalOauthPort = 8443 +) + +var ( + excludeManifests = sets.NewString( + "openshift-apiserver-service.yaml", + "v4-0-config-system-branding.yaml", + "oauth-server-service.yaml", + "kube-apiserver-service.yaml", + ) + + version46 = semver.MustParse("4.6.0") +) + +type InfrastructureStatus struct { + APIAddress string + OAuthAddress string + VPNAddress string + OpenShiftAPIAddress string + OauthAPIServerAddress string + IgnitionProviderAddress string +} + +func (s InfrastructureStatus) IsReady() bool { + return len(s.APIAddress) > 0 && + len(s.OAuthAddress) > 0 && + len(s.VPNAddress) > 0 && + len(s.IgnitionProviderAddress) > 0 +} + +type HostedControlPlaneReconciler struct { + client.Client + + Log logr.Logger + ReleaseProvider releaseinfo.Provider + + recorder record.EventRecorder +} + +func (r *HostedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error { + _, err := ctrl.NewControllerManagedBy(mgr). + For(&hyperv1.HostedControlPlane{}). + WithOptions(controller.Options{ + RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second), + }). + Build(r) + if err != nil { + return fmt.Errorf("failed setting up with a controller manager %w", err) + } + + r.recorder = mgr.GetEventRecorderFor("hosted-control-plane-controller") + + return nil +} + +func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + r.Log = ctrl.LoggerFrom(ctx) + r.Log.Info("Reconciling") + + // Fetch the hostedControlPlane instance + hostedControlPlane := &hyperv1.HostedControlPlane{} + err := r.Client.Get(ctx, req.NamespacedName, hostedControlPlane) + if err != nil { + if apierrors.IsNotFound(err) { + return ctrl.Result{}, nil + } + return ctrl.Result{}, err + } + + // Fetch the Cluster. + cluster, err := util.GetOwnerCluster(ctx, r.Client, hostedControlPlane.ObjectMeta) + if err != nil { + return ctrl.Result{}, err + } + + if cluster == nil { + r.Log.Info("Cluster Controller has not yet set OwnerRef") + return ctrl.Result{}, nil + } + + if util.IsPaused(cluster, hostedControlPlane) { + r.Log.Info("HostedControlPlane or linked Cluster is marked as paused. Won't reconcile") + return ctrl.Result{}, nil + } + + // Return early if deleted + if !hostedControlPlane.DeletionTimestamp.IsZero() { + if err := r.delete(ctx, hostedControlPlane); err != nil { + r.Log.Error(err, "failed to delete cluster") + return ctrl.Result{}, err + } + if controllerutil.ContainsFinalizer(hostedControlPlane, finalizer) { + controllerutil.RemoveFinalizer(hostedControlPlane, finalizer) + if err := r.Update(ctx, hostedControlPlane); err != nil { + return ctrl.Result{}, fmt.Errorf("failed to remove finalizer from cluster: %w", err) + } + } + return ctrl.Result{}, nil + } + + // Ensure the hostedControlPlane has a finalizer for cleanup + if !controllerutil.ContainsFinalizer(hostedControlPlane, finalizer) { + controllerutil.AddFinalizer(hostedControlPlane, finalizer) + if err := r.Update(ctx, hostedControlPlane); err != nil { + return ctrl.Result{}, fmt.Errorf("failed to add finalizer to hostedControlPlane: %w", err) + } + } + + r.Log = r.Log.WithValues("cluster", cluster.Name) + + patchHelper, err := patch.NewHelper(hostedControlPlane, r.Client) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to init patch helper: %w", err) + } + + var result ctrl.Result + // TODO (alberto): + // May be eventually just run a deployment with a CVO running a hostedControlPlane profile + // passing the hostedControlPlane.spec.version through? + + if hostedControlPlane.Status.Ready { + r.Log.Info("Is ready") + return result, nil + } + + r.Log.Info("Creating API services") + infraStatus, err := r.ensureInfrastructure(ctx, hostedControlPlane) + if err != nil { + r.Log.Error(err, "failed to ensure infrastructure") + return result, fmt.Errorf("failed to ensure infrastructure: %w", err) + } + + // Wait for things like LB services to become available + if !infraStatus.IsReady() { + result.RequeueAfter = 5 * time.Second + r.Log.Info("Cluster infrastructure is still provisioning, will try again later") + return result, nil + } + hostedControlPlane.Status.ControlPlaneEndpoint = hyperv1.APIEndpoint{ + Host: infraStatus.APIAddress, + Port: APIServerPort, + } + + releaseImage, err := r.ReleaseProvider.Lookup(ctx, hostedControlPlane.Spec.ReleaseImage) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to look up release info: %w", err) + } + componentVersions, err := releaseImage.ComponentVersions() + if err != nil { + return ctrl.Result{}, fmt.Errorf("invalid component versions found in release info: %w", err) + } + r.Log.Info("found release info for image", "releaseImage", hostedControlPlane.Spec.ReleaseImage, "info", releaseImage, "componentImages", releaseImage.ComponentImages(), "componentVersions", componentVersions) + + // Install the control plane into the infrastructure + r.Log.Info("Creating hosted control plane") + err = r.ensureControlPlane(ctx, hostedControlPlane, infraStatus, releaseImage) + if err != nil { + r.Log.Error(err, "failed to ensure control plane") + return result, fmt.Errorf("failed to ensure control plane: %w", err) + } + + hostedControlPlane.Status.Ready = true + if err := patchHelper.Patch(ctx, hostedControlPlane); err != nil { + return ctrl.Result{}, fmt.Errorf("failed to patch: %w", err) + } + + r.Log.Info("Successfully reconciled") + return ctrl.Result{}, nil +} + +func (r *HostedControlPlaneReconciler) delete(ctx context.Context, hcp *hyperv1.HostedControlPlane) error { + releaseImage, err := r.ReleaseProvider.Lookup(ctx, hcp.Spec.ReleaseImage) + if err != nil { + return fmt.Errorf("failed to look up release info: %w", err) + } + manifests, err := r.generateControlPlaneManifests(ctx, hcp, InfrastructureStatus{}, releaseImage) + if err != nil { + return nil + } + if err := deleteManifests(ctx, r, r.Log, hcp.GetName(), manifests); err != nil { + return err + } + return nil +} + +func (r *HostedControlPlaneReconciler) ensureInfrastructure(ctx context.Context, hcp *hyperv1.HostedControlPlane) (InfrastructureStatus, error) { + status := InfrastructureStatus{} + + targetNamespace := hcp.GetName() + // Ensure that we can run privileged pods + if err := ensureVPNSCC(r, hcp, targetNamespace); err != nil { + return status, fmt.Errorf("failed to ensure privileged SCC for the new namespace: %w", err) + } + + baseDomain, err := clusterBaseDomain(r.Client, ctx, hcp.Name) + if err != nil { + return status, fmt.Errorf("couldn't determine cluster base domain name: %w", err) + } + + // Create Kube APIServer service + r.Log.Info("Creating Kube API service") + apiService, err := createKubeAPIServerService(r, hcp, targetNamespace) + if err != nil { + return status, fmt.Errorf("failed to create Kube API service: %w", err) + } + r.Log.Info("Created Kube API service") + + r.Log.Info("Creating VPN service") + vpnService, err := createVPNServerService(r, hcp, targetNamespace) + if err != nil { + return status, fmt.Errorf("failed to create vpn server service: %w", err) + } + r.Log.Info("Created VPN service") + + r.Log.Info("Creating Openshift API service") + openshiftAPIService, err := createOpenshiftService(r, hcp, targetNamespace) + if err != nil { + return status, fmt.Errorf("failed to create openshift server service: %w", err) + } + r.Log.Info("Created Openshift API service") + + r.Log.Info("Creating Openshift OAuth API service") + oauthAPIService, err := createOauthAPIService(r, hcp, targetNamespace) + if err != nil { + return status, fmt.Errorf("failed to create openshift oauth api service: %w", err) + } + r.Log.Info("Created Openshift Oauth API service") + + r.Log.Info("Creating OAuth service") + oauthService, err := createOauthService(r, hcp, targetNamespace) + if err != nil { + return status, fmt.Errorf("error creating service for oauth: %w", err) + } + + r.Log.Info("Creating router shard") + if err := createIngressController(r, hcp, targetNamespace, baseDomain); err != nil { + return status, fmt.Errorf("cannot create router shard: %w", err) + } + + r.Log.Info("Creating ignition provider route") + ignitionRoute := createIgnitionServerRoute(targetNamespace) + ignitionRoute.OwnerReferences = ensureHCPOwnerRef(hcp, ignitionRoute.OwnerReferences) + if err := r.Create(ctx, ignitionRoute); err != nil && !apierrors.IsAlreadyExists(err) { + return status, fmt.Errorf("failed to create ignition route: %w", err) + } + + apiAddress, err := getLoadBalancerServiceAddress(r, ctx, client.ObjectKeyFromObject(apiService)) + if err != nil { + return status, fmt.Errorf("failed to get service: %w", err) + } + status.APIAddress = apiAddress + + oauthAddress, err := getLoadBalancerServiceAddress(r, ctx, client.ObjectKeyFromObject(oauthService)) + if err != nil { + return status, fmt.Errorf("failed to get service: %w", err) + } + status.OAuthAddress = oauthAddress + + vpnAddress, err := getLoadBalancerServiceAddress(r, ctx, client.ObjectKeyFromObject(vpnService)) + if err != nil { + return status, fmt.Errorf("failed to get service: %w", err) + } + status.VPNAddress = vpnAddress + + ignitionAddress, err := getRouteAddress(r, ctx, client.ObjectKeyFromObject(ignitionRoute)) + if err != nil { + return status, fmt.Errorf("failed get get route address: %w", err) + } + status.IgnitionProviderAddress = ignitionAddress + + status.OpenShiftAPIAddress = openshiftAPIService.Spec.ClusterIP + status.OauthAPIServerAddress = oauthAPIService.Spec.ClusterIP + + return status, nil +} + +func (r *HostedControlPlaneReconciler) ensureControlPlane(ctx context.Context, hcp *hyperv1.HostedControlPlane, infraStatus InfrastructureStatus, releaseImage *releaseinfo.ReleaseImage) error { + r.Log.Info("ensuring control plane for cluster", "cluster", hcp.Name) + + targetNamespace := hcp.GetName() + version, err := semver.Parse(releaseImage.Version()) + if err != nil { + return fmt.Errorf("cannot parse release version (%s): %v", releaseImage.Version(), err) + } + + // Create the configmap with the pull secret for the guest cluster + var pullSecret corev1.Secret + if err := r.Client.Get(ctx, client.ObjectKey{Namespace: targetNamespace, Name: pullSecretName}, &pullSecret); err != nil { + return fmt.Errorf("failed to get pull secret %s: %w", pullSecretName, err) + } + pullSecretData, hasPullSecretData := pullSecret.Data[".dockerconfigjson"] + if !hasPullSecretData { + return fmt.Errorf("pull secret %s is missing the .dockerconfigjson key", pullSecretName) + } + targetPullSecret, err := generateTargetPullSecret(r.Scheme(), pullSecretData, targetNamespace) + if err != nil { + return fmt.Errorf("failed to create pull secret manifest for target cluster: %w", err) + } + if err := r.Create(ctx, targetPullSecret); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to generate targetPullSecret: %v", err) + } + + manifests, err := r.generateControlPlaneManifests(ctx, hcp, infraStatus, releaseImage) + if err != nil { + return err + } + + // Create oauth branding manifest because it cannot be applied + manifestBytes := manifests[oauthBrandingManifest] + manifestObj := &unstructured.Unstructured{} + if err := yaml.NewYAMLOrJSONDecoder(strings.NewReader(string(manifestBytes)), 100).Decode(manifestObj); err != nil { + return fmt.Errorf("failed to decode manifest %s: %w", oauthBrandingManifest, err) + } + manifestObj.SetNamespace(targetNamespace) + if err = r.Create(context.TODO(), manifestObj); err != nil { + if !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to apply manifest %s: %w", oauthBrandingManifest, err) + } + } + + if err := applyManifests(ctx, r, r.Log, targetNamespace, manifests); err != nil { + return err + } + r.Log.Info("successfully applied all manifests") + + userDataSecret := generateUserDataSecret(hcp.GetName(), hcp.GetNamespace(), infraStatus.IgnitionProviderAddress, version) + if err := r.Create(ctx, userDataSecret); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to generate user data secret: %w", err) + } + userDataSecret.OwnerReferences = ensureHCPOwnerRef(hcp, userDataSecret.OwnerReferences) + + kubeadminPassword, err := generateKubeadminPassword() + if err != nil { + return fmt.Errorf("failed to generate kubeadmin password: %w", err) + } + + kubeadminPasswordTargetSecret, err := generateKubeadminPasswordTargetSecret(r.Scheme(), kubeadminPassword, targetNamespace) + if err != nil { + return fmt.Errorf("failed to create kubeadmin secret manifest for target cluster: %w", err) + } + kubeadminPasswordTargetSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeadminPasswordTargetSecret.OwnerReferences) + if err := r.Create(ctx, kubeadminPasswordTargetSecret); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to generate kubeadminPasswordTargetSecret: %w", err) + } + + kubeadminPasswordSecret := generateKubeadminPasswordSecret(targetNamespace, kubeadminPassword) + kubeadminPasswordSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeadminPasswordSecret.OwnerReferences) + if err := r.Create(ctx, kubeadminPasswordSecret); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to generate kubeadminPasswordSecret: %w", err) + } + + pkiSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: targetNamespace, + Name: "pki", + }, + Data: map[string][]byte{}, + } + if err := r.Get(ctx, client.ObjectKeyFromObject(pkiSecret), pkiSecret); err != nil { + return fmt.Errorf("failed to get pki secret: %w", err) + } + + kubeconfigSecret, err := generateKubeconfigSecret(hcp.GetName(), hcp.GetNamespace(), pkiSecret.Data["admin.kubeconfig"]) + if err != nil { + return fmt.Errorf("failed to create kubeconfig secret manifest for management cluster: %w", err) + } + kubeconfigSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeconfigSecret.OwnerReferences) + if err := r.Create(ctx, kubeconfigSecret); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to generate kubeconfigSecret: %w", err) + } + + baseDomain, err := clusterBaseDomain(r.Client, ctx, hcp.Name) + if err != nil { + return fmt.Errorf("couldn't determine cluster base domain name: %w", err) + } + r.Log.Info(fmt.Sprintf("Cluster API URL: %s", fmt.Sprintf("https://%s:%d", infraStatus.APIAddress, APIServerPort))) + r.Log.Info(fmt.Sprintf("Kubeconfig is available in secret %q in the %s namespace", fmt.Sprintf("%s-kubeconfig", targetNamespace), hcp.GetNamespace())) + r.Log.Info(fmt.Sprintf("Console URL: %s", fmt.Sprintf("https://console-openshift-console.%s", fmt.Sprintf("apps.%s", baseDomain)))) + r.Log.Info(fmt.Sprintf("kubeadmin password is available in secret %q in the %s namespace", "kubeadmin-password", targetNamespace)) + + return nil +} + +func (r *HostedControlPlaneReconciler) generateControlPlaneManifests(ctx context.Context, hcp *hyperv1.HostedControlPlane, infraStatus InfrastructureStatus, releaseImage *releaseinfo.ReleaseImage) (map[string][]byte, error) { + targetNamespace := hcp.GetName() + + var sshKeySecret corev1.Secret + err := r.Client.Get(ctx, client.ObjectKey{Namespace: hcp.Namespace, Name: hcp.Spec.SSHKey.Name}, &sshKeySecret) + if err != nil { + return nil, fmt.Errorf("failed to get SSH key secret %s: %w", hcp.Spec.SSHKey.Name, err) + } + sshKeyData, hasSSHKeyData := sshKeySecret.Data["id_rsa.pub"] + if !hasSSHKeyData { + return nil, fmt.Errorf("SSH key secret secret %s is missing the id_rsa.pub key", hcp.Spec.SSHKey.Name) + } + baseDomain, err := clusterBaseDomain(r.Client, ctx, hcp.Name) + if err != nil { + return nil, fmt.Errorf("couldn't determine cluster base domain name: %w", err) + } + + var clusterInfra configv1.Infrastructure + if err := r.Get(context.Background(), client.ObjectKey{Name: "cluster"}, &clusterInfra); err != nil { + return nil, fmt.Errorf("failed to get cluster infra: %w", err) + } + + params := render.NewClusterParams() + params.Namespace = targetNamespace + params.ExternalAPIDNSName = infraStatus.APIAddress + params.ExternalAPIPort = APIServerPort + params.ExternalAPIAddress = DefaultAPIServerIPAddress + params.ExternalOpenVPNAddress = infraStatus.VPNAddress + params.ExternalOpenVPNPort = 1194 + params.ExternalOauthDNSName = infraStatus.OAuthAddress + params.ExternalOauthPort = externalOauthPort + params.ServiceCIDR = hcp.Spec.ServiceCIDR + params.PodCIDR = hcp.Spec.PodCIDR + params.ReleaseImage = hcp.Spec.ReleaseImage + params.IngressSubdomain = fmt.Sprintf("apps.%s", baseDomain) + params.OpenShiftAPIClusterIP = infraStatus.OpenShiftAPIAddress + params.OauthAPIClusterIP = infraStatus.OauthAPIServerAddress + params.BaseDomain = baseDomain + params.MachineConfigServerAddress = infraStatus.IgnitionProviderAddress + params.CloudProvider = string(clusterInfra.Status.PlatformStatus.Type) + params.PlatformType = string(clusterInfra.Status.PlatformStatus.Type) + params.InternalAPIPort = APIServerPort + params.EtcdClientName = "etcd-client" + params.NetworkType = "OpenShiftSDN" + params.ImageRegistryHTTPSecret = generateImageRegistrySecret() + params.Replicas = "1" + params.SSHKey = string(sshKeyData) + params.HypershiftOperatorControllers = []string{"route-sync", "auto-approver", "kubeadmin-password", "node"} + + // Generate PKI data just once and store it in a secret. PKI generation isn't + // deterministic and shouldn't be performed with every reconcile, otherwise + // we're effectively doing an uncontrolled cert rotation each generation. + pkiSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: targetNamespace, + Name: "pki", + }, + Data: map[string][]byte{}, + } + needsPkiSecret := false + if err := r.Get(ctx, client.ObjectKeyFromObject(pkiSecret), pkiSecret); err != nil { + if apierrors.IsNotFound(err) { + needsPkiSecret = true + } else { + return nil, fmt.Errorf("failed to get pki secret: %w", err) + } + } else { + r.Log.Info("using existing pki secret") + } + if needsPkiSecret { + pkiParams := &render.PKIParams{ + ExternalAPIAddress: infraStatus.APIAddress, + NodeInternalAPIServerIP: DefaultAPIServerIPAddress, + ExternalAPIPort: APIServerPort, + InternalAPIPort: APIServerPort, + ServiceCIDR: hcp.Spec.ServiceCIDR, + ExternalOauthAddress: infraStatus.OAuthAddress, + IngressSubdomain: "apps." + baseDomain, + MachineConfigServerAddress: infraStatus.IgnitionProviderAddress, + ExternalOpenVPNAddress: infraStatus.VPNAddress, + Namespace: targetNamespace, + } + r.Log.Info("generating PKI secret data") + data, err := pki.GeneratePKI(pkiParams) + if err != nil { + return nil, fmt.Errorf("failed to generate PKI data: %w", err) + } + pkiSecret.Data = data + if err := r.Create(ctx, pkiSecret); err != nil { + return nil, fmt.Errorf("failed to create pki secret: %w", err) + } + r.Log.Info("created pki secret") + } + + caBytes, hasData := pkiSecret.Data["combined-ca.crt"] + if !hasData { + return nil, fmt.Errorf("pki secret %q is missing combined-ca.crt key", pkiSecret.Name) + } + params.OpenshiftAPIServerCABundle = base64.StdEncoding.EncodeToString(caBytes) + params.OauthAPIServerCABundle = params.OpenshiftAPIServerCABundle + + var pullSecret corev1.Secret + if err := r.Client.Get(ctx, client.ObjectKey{Namespace: hcp.GetNamespace(), Name: hcp.Spec.PullSecret.Name}, &pullSecret); err != nil { + return nil, fmt.Errorf("failed to get pull secret %s: %w", hcp.Spec.PullSecret.Name, err) + } + pullSecretData, hasPullSecretData := pullSecret.Data[".dockerconfigjson"] + if !hasPullSecretData { + return nil, fmt.Errorf("pull secret %s is missing the .dockerconfigjson key", hcp.Spec.PullSecret.Name) + } + manifests, err := render.RenderClusterManifests(params, releaseImage, pullSecretData, pkiSecret.Data) + if err != nil { + return nil, fmt.Errorf("failed to render hypershift manifests for cluster: %w", err) + } + return manifests, nil +} + +func createKubeAPIServerService(client client.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { + svc := &corev1.Service{} + svc.Namespace = namespace + svc.Name = kubeAPIServerServiceName + svc.Spec.Selector = map[string]string{"app": "kube-apiserver"} + svc.Spec.Type = corev1.ServiceTypeLoadBalancer + svc.Spec.Ports = []corev1.ServicePort{ + { + Port: 6443, + Protocol: corev1.ProtocolTCP, + TargetPort: intstr.FromInt(6443), + }, + } + svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) + if err := client.Create(context.TODO(), svc); err != nil { + if !apierrors.IsAlreadyExists(err) { + return nil, fmt.Errorf("failed to create api server service: %w", err) + } + } + return svc, nil +} + +func createVPNServerService(client client.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { + svc := &corev1.Service{} + svc.Namespace = namespace + svc.Name = vpnServiceName + svc.Spec.Selector = map[string]string{"app": "openvpn-server"} + svc.Spec.Type = corev1.ServiceTypeLoadBalancer + svc.Spec.Ports = []corev1.ServicePort{ + { + Port: 1194, + Protocol: corev1.ProtocolTCP, + TargetPort: intstr.FromInt(1194), + }, + } + svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) + if err := client.Create(context.TODO(), svc); err != nil { + if !apierrors.IsAlreadyExists(err) { + return nil, fmt.Errorf("failed to create vpn server service: %w", err) + } + } + return svc, nil +} + +func createOpenshiftService(c client.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { + svc := &corev1.Service{} + svc.Namespace = namespace + svc.Name = "openshift-apiserver" + svc.Spec.Selector = map[string]string{"app": "openshift-apiserver"} + svc.Spec.Type = corev1.ServiceTypeClusterIP + svc.Spec.Ports = []corev1.ServicePort{ + { + Name: "https", + Port: 443, + Protocol: corev1.ProtocolTCP, + TargetPort: intstr.FromInt(8443), + }, + } + svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) + if err := c.Create(context.TODO(), svc); err != nil { + if apierrors.IsAlreadyExists(err) { + return svc, c.Get(context.TODO(), client.ObjectKeyFromObject(svc), svc) + } else { + return nil, fmt.Errorf("failed to create openshift service: %w", err) + } + } + return svc, nil +} + +func createOauthAPIService(c client.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { + svc := &corev1.Service{} + svc.Namespace = namespace + svc.Name = "openshift-oauth-apiserver" + svc.Spec.Selector = map[string]string{"app": "openshift-oauth-apiserver"} + svc.Spec.Type = corev1.ServiceTypeClusterIP + svc.Spec.Ports = []corev1.ServicePort{ + { + Name: "https", + Port: 443, + Protocol: corev1.ProtocolTCP, + TargetPort: intstr.FromInt(8443), + }, + } + svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) + if err := c.Create(context.TODO(), svc); err != nil { + if apierrors.IsAlreadyExists(err) { + return svc, c.Get(context.TODO(), client.ObjectKeyFromObject(svc), svc) + } else { + return nil, fmt.Errorf("failed to create openshift service: %w", err) + } + } + return svc, nil +} + +func createOauthService(client client.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { + svc := &corev1.Service{} + svc.Namespace = namespace + svc.Name = oauthServiceName + svc.Spec.Selector = map[string]string{"app": "oauth-openshift"} + svc.Spec.Type = corev1.ServiceTypeLoadBalancer + svc.Spec.Ports = []corev1.ServicePort{ + { + Name: "https", + Port: 8443, + Protocol: corev1.ProtocolTCP, + TargetPort: intstr.FromInt(6443), + }, + } + svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) + err := client.Create(context.TODO(), svc) + if err != nil && !apierrors.IsAlreadyExists(err) { + return nil, fmt.Errorf("failed to create oauth service: %w", err) + } + return svc, nil +} + +func ensureVPNSCC(c client.Client, hcp *hyperv1.HostedControlPlane, namespace string) error { + scc := &securityv1.SecurityContextConstraints{} + if err := c.Get(context.TODO(), client.ObjectKey{Name: "privileged"}, scc); err != nil { + return fmt.Errorf("failed to get privileged scc: %w", err) + } + userSet := sets.NewString(scc.Users...) + svcAccount := fmt.Sprintf("system:serviceaccount:%s:%s", namespace, vpnServiceAccountName) + if userSet.Has(svcAccount) { + return nil + } + userSet.Insert(svcAccount) + scc.Users = userSet.List() + scc.OwnerReferences = ensureHCPOwnerRef(hcp, scc.OwnerReferences) + if err := c.Update(context.TODO(), scc); err != nil { + return fmt.Errorf("failed to update privileged scc: %w", err) + } + return nil +} + +func createIngressController(c client.Client, hcp *hyperv1.HostedControlPlane, name string, parentDomain string) error { + // First ensure that the default ingress controller doesn't use routes generated for hypershift clusters + err := ensureDefaultIngressControllerSelector(c) + if err != nil { + return err + } + ic := &operatorv1.IngressController{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: ingressOperatorNamespace, + }, + Spec: operatorv1.IngressControllerSpec{ + Domain: fmt.Sprintf("apps.%s", parentDomain), + RouteSelector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + hypershiftRouteLabel: name, + }, + }, + }, + } + ic.OwnerReferences = ensureHCPOwnerRef(hcp, ic.OwnerReferences) + if err := c.Create(context.TODO(), ic); err != nil && !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("failed to create ingress controller for %s: %w", name, err) + } + return nil +} + +func ensureDefaultIngressControllerSelector(c client.Client) error { + defaultIC := &operatorv1.IngressController{} + if err := c.Get(context.TODO(), client.ObjectKey{Namespace: ingressOperatorNamespace, Name: "default"}, defaultIC); err != nil { + return fmt.Errorf("failed to fetch default ingress controller: %w", err) + } + routeSelector := defaultIC.Spec.RouteSelector + if routeSelector == nil { + routeSelector = &metav1.LabelSelector{} + } + found := false + for _, exp := range routeSelector.MatchExpressions { + if exp.Key == hypershiftRouteLabel && exp.Operator == metav1.LabelSelectorOpDoesNotExist { + found = true + break + } + } + if !found { + routeSelector.MatchExpressions = append(routeSelector.MatchExpressions, metav1.LabelSelectorRequirement{ + Key: hypershiftRouteLabel, + Operator: metav1.LabelSelectorOpDoesNotExist, + }) + defaultIC.Spec.RouteSelector = routeSelector + if err := c.Update(context.TODO(), defaultIC); err != nil { + return fmt.Errorf("failed to update default ingress controller: %w", err) + } + } + return nil +} + +func createIgnitionServerRoute(namespace string) *routev1.Route { + return &routev1.Route{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + Name: "ignition-provider", + }, + Spec: routev1.RouteSpec{ + To: routev1.RouteTargetReference{ + Kind: "Service", + Name: "machine-config-server", + }, + }, + } +} + +func getLoadBalancerServiceAddress(c client.Client, ctx context.Context, key client.ObjectKey) (string, error) { + svc := &corev1.Service{} + if err := c.Get(ctx, key, svc); err != nil { + return "", fmt.Errorf("failed to get service: %w", err) + } + var addr string + if len(svc.Status.LoadBalancer.Ingress) > 0 { + switch { + case svc.Status.LoadBalancer.Ingress[0].Hostname != "": + addr = svc.Status.LoadBalancer.Ingress[0].Hostname + case svc.Status.LoadBalancer.Ingress[0].IP != "": + addr = svc.Status.LoadBalancer.Ingress[0].IP + } + } + return addr, nil +} + +func getRouteAddress(c client.Client, ctx context.Context, key client.ObjectKey) (string, error) { + route := &routev1.Route{} + if err := c.Get(ctx, key, route); err != nil { + return "", fmt.Errorf("failed to get route: %w", err) + } + var addr string + if len(route.Spec.Host) > 0 { + addr = route.Spec.Host + } + return addr, nil +} + +func deleteManifests(ctx context.Context, c client.Client, log logr.Logger, namespace string, manifests map[string][]byte) error { + // Use server side apply for manifestss + applyErrors := []error{} + for manifestName, manifestBytes := range manifests { + if excludeManifests.Has(manifestName) { + continue + } + obj := &unstructured.Unstructured{} + if err := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(manifestBytes), 100).Decode(obj); err != nil { + applyErrors = append(applyErrors, fmt.Errorf("failed to decode manifest %s: %w", manifestName, err)) + } + obj.SetNamespace(namespace) + err := c.Delete(ctx, obj) + if err != nil && !apierrors.IsNotFound(err) && !meta.IsNoMatchError(err) { + applyErrors = append(applyErrors, fmt.Errorf("failed to delete manifest %s: %w", manifestName, err)) + } else { + log.Info("deleted manifest", "manifest", manifestName) + } + } + if errs := errors.NewAggregate(applyErrors); errs != nil { + return fmt.Errorf("failed to delete some manifests: %w", errs) + } + return nil +} + +func clusterBaseDomain(c client.Client, ctx context.Context, clusterName string) (string, error) { + var dnsConfig configv1.DNS + err := c.Get(ctx, client.ObjectKey{Name: "cluster"}, &dnsConfig) + if err != nil { + return "", fmt.Errorf("failed to get cluster dns config: %w", err) + } + return fmt.Sprintf("%s.%s", clusterName, dnsConfig.Spec.BaseDomain), nil +} + +func ensureHCPOwnerRef(hcp *hyperv1.HostedControlPlane, ownerReferences []metav1.OwnerReference) []metav1.OwnerReference { + return util.EnsureOwnerRef(ownerReferences, metav1.OwnerReference{ + APIVersion: hyperv1.GroupVersion.String(), + Kind: "HostedControlPlane", + Name: hcp.GetName(), + UID: hcp.UID, + }) +} + +func generateTargetPullSecret(scheme *runtime.Scheme, data []byte, namespace string) (*corev1.ConfigMap, error) { + secret := &corev1.Secret{} + secret.Name = "pull-secret" + secret.Namespace = "openshift-config" + secret.Data = map[string][]byte{".dockerconfigjson": data} + secret.Type = corev1.SecretTypeDockerConfigJson + secretBytes, err := runtime.Encode(serializer.NewCodecFactory(scheme).LegacyCodec(corev1.SchemeGroupVersion), secret) + if err != nil { + return nil, err + } + configMap := &corev1.ConfigMap{} + configMap.Namespace = namespace + configMap.Name = "user-manifest-pullsecret" + configMap.Data = map[string]string{"data": string(secretBytes)} + return configMap, nil +} + +func applyManifests(ctx context.Context, c client.Client, log logr.Logger, namespace string, manifests map[string][]byte) error { + // Use server side apply for manifestss + applyErrors := []error{} + for manifestName, manifestBytes := range manifests { + if excludeManifests.Has(manifestName) { + continue + } + obj := &unstructured.Unstructured{} + if err := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(manifestBytes), 100).Decode(obj); err != nil { + applyErrors = append(applyErrors, fmt.Errorf("failed to decode manifest %s: %w", manifestName, err)) + } + obj.SetNamespace(namespace) + err := c.Patch(ctx, obj, client.RawPatch(types.ApplyPatchType, manifestBytes), client.ForceOwnership, client.FieldOwner("control-plane-operator")) + if err != nil { + applyErrors = append(applyErrors, fmt.Errorf("failed to apply manifest %s: %w", manifestName, err)) + } else { + log.Info("applied manifest", "manifest", manifestName) + } + } + if errs := errors.NewAggregate(applyErrors); errs != nil { + return fmt.Errorf("failed to apply some manifests: %w", errs) + } + return nil +} + +func generateUserDataSecret(name, namespace string, ignitionProviderAddr string, version semver.Version) *corev1.Secret { + secret := &corev1.Secret{} + secret.Name = fmt.Sprintf("%s-user-data", name) + secret.Namespace = namespace + + disableTemplatingValue := []byte(base64.StdEncoding.EncodeToString([]byte("true"))) + var userDataValue []byte + + // Clear any version modifiers for this comparison + version.Pre = nil + version.Build = nil + if version.GTE(version46) { + userDataValue = []byte(fmt.Sprintf(`{"ignition":{"config":{"merge":[{"source":"http://%s/config/master","verification":{}}]},"security":{},"timeouts":{},"version":"3.1.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}`, ignitionProviderAddr)) + } else { + userDataValue = []byte(fmt.Sprintf(`{"ignition":{"config":{"append":[{"source":"http://%s/config/master","verification":{}}]},"security":{},"timeouts":{},"version":"2.2.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}`, ignitionProviderAddr)) + } + + secret.Data = map[string][]byte{ + "disableTemplating": disableTemplatingValue, + "value": userDataValue, + } + return secret +} + +func generateKubeadminPassword() (string, error) { + const ( + lowerLetters = "abcdefghijkmnopqrstuvwxyz" + upperLetters = "ABCDEFGHIJKLMNPQRSTUVWXYZ" + digits = "23456789" + all = lowerLetters + upperLetters + digits + length = 23 + ) + var password string + for i := 0; i < length; i++ { + n, err := crand.Int(crand.Reader, big.NewInt(int64(len(all)))) + if err != nil { + return "", err + } + newchar := string(all[n.Int64()]) + if password == "" { + password = newchar + } + if i < length-1 { + n, err = crand.Int(crand.Reader, big.NewInt(int64(len(password)+1))) + if err != nil { + return "", err + } + j := n.Int64() + password = password[0:j] + newchar + password[j:] + } + } + pw := []rune(password) + for _, replace := range []int{5, 11, 17} { + pw[replace] = '-' + } + return string(pw), nil +} + +func generateKubeadminPasswordTargetSecret(scheme *runtime.Scheme, password string, namespace string) (*corev1.ConfigMap, error) { + secret := &corev1.Secret{} + secret.APIVersion = "v1" + secret.Kind = "Secret" + secret.Name = "kubeadmin" + secret.Namespace = "kube-system" + passwordHash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) + if err != nil { + return nil, err + } + secret.Data = map[string][]byte{"kubeadmin": passwordHash} + + secretBytes, err := runtime.Encode(serializer.NewCodecFactory(scheme).LegacyCodec(corev1.SchemeGroupVersion), secret) + if err != nil { + return nil, err + } + configMap := &corev1.ConfigMap{} + configMap.Namespace = namespace + configMap.Name = "user-manifest-kubeadmin-password" + configMap.Data = map[string]string{"data": string(secretBytes)} + return configMap, nil +} + +func generateKubeadminPasswordSecret(namespace, password string) *corev1.Secret { + secret := &corev1.Secret{} + secret.Namespace = namespace + secret.Name = "kubeadmin-password" + secret.Data = map[string][]byte{"password": []byte(password)} + return secret +} + +func generateKubeconfigSecret(name, namespace string, kubeconfigBytes []byte) (*corev1.Secret, error) { + secret := &corev1.Secret{} + secret.Namespace = namespace + secret.Name = fmt.Sprintf("%s-kubeconfig", name) + secret.Data = map[string][]byte{"value": kubeconfigBytes} + return secret, nil +} + +func generateImageRegistrySecret() string { + num := make([]byte, 64) + rand.Read(num) + return hex.EncodeToString(num) +} diff --git a/hypershift-operator/render/controlplane/hypershift/funcs.go b/control-plane-operator/controllers/hostedcontrolplane/render/funcs.go similarity index 99% rename from hypershift-operator/render/controlplane/hypershift/funcs.go rename to control-plane-operator/controllers/hostedcontrolplane/render/funcs.go index 2fda8f9d774d..3ebeef5845c8 100644 --- a/hypershift-operator/render/controlplane/hypershift/funcs.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/funcs.go @@ -1,4 +1,4 @@ -package hypershift +package render import ( "bufio" diff --git a/hypershift-operator/render/controlplane/hypershift/manifests.go b/control-plane-operator/controllers/hostedcontrolplane/render/manifests.go similarity index 92% rename from hypershift-operator/render/controlplane/hypershift/manifests.go rename to control-plane-operator/controllers/hostedcontrolplane/render/manifests.go index 91e72cd37d38..0f7d3b8a7dea 100644 --- a/hypershift-operator/render/controlplane/hypershift/manifests.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/manifests.go @@ -1,4 +1,4 @@ -package hypershift +package render import ( "bytes" @@ -7,21 +7,10 @@ import ( "strings" "text/template" - assets "openshift.io/hypershift/hypershift-operator/assets/controlplane/hypershift" - "openshift.io/hypershift/hypershift-operator/releaseinfo" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/assets" + "openshift.io/hypershift/control-plane-operator/releaseinfo" ) -// RenderClusterManifests renders manifests for a hosted control plane cluster -func RenderCAPIManifests(params *ClusterParams, image *releaseinfo.ReleaseImage, pullSecret []byte, pki map[string][]byte) (map[string][]byte, error) { - componentVersions, err := image.ComponentVersions() - if err != nil { - return nil, err - } - ctx := newClusterManifestContext(image.ComponentImages(), componentVersions, params, pullSecret, pki) - ctx.capi() - return ctx.renderManifests() -} - func RenderClusterManifests(params *ClusterParams, image *releaseinfo.ReleaseImage, pullSecret []byte, pki map[string][]byte) (map[string][]byte, error) { componentVersions, err := image.ComponentVersions() if err != nil { @@ -66,6 +55,7 @@ func newClusterManifestContext(images, versions map[string]string, params interf } func (c *clusterManifestContext) setupManifests() { + c.hostedClusterConfigOperator() c.serviceAdminKubeconfig() c.etcd() c.kubeAPIServer() @@ -76,23 +66,15 @@ func (c *clusterManifestContext) setupManifests() { c.oauthAPIServer() c.openshiftControllerManager() c.clusterBootstrap() - c.hostedClusterConfigOperator() c.oauthOpenshiftServer() c.openVPN() c.registry() - // c.roksMetrics() c.userManifestsBootstrapper() c.routerProxy() c.machineConfigServer() c.ignitionConfigs() } -func (c *clusterManifestContext) serviceAdminKubeconfig() { - c.addManifestFiles( - "common/service-network-admin-kubeconfig-secret.yaml", - ) -} - func (c *clusterManifestContext) hostedClusterConfigOperator() { c.addManifestFiles( "hosted-cluster-config-operator/cp-operator-serviceaccount.yaml", @@ -103,6 +85,12 @@ func (c *clusterManifestContext) hostedClusterConfigOperator() { ) } +func (c *clusterManifestContext) serviceAdminKubeconfig() { + c.addManifestFiles( + "common/service-network-admin-kubeconfig-secret.yaml", + ) +} + func (c *clusterManifestContext) etcd() { c.addManifestFiles( "etcd/etcd-cluster-crd.yaml", @@ -162,19 +150,6 @@ func (c *clusterManifestContext) kubeAPIServer() { ) } -func (c *clusterManifestContext) capi() { - c.addManifestFiles( - "capi/capa-manager-serviceaccount.yaml", - "capi/capa-manager-clusterrole.yaml", - "capi/capa-manager-clusterrolebinding.yaml", - "capi/capa-manager-deployment.yaml", - "capi/manager-serviceaccount.yaml", - "capi/manager-clusterrole.yaml", - "capi/manager-clusterrolebinding.yaml", - "capi/manager-deployment.yaml", - ) -} - func (c *clusterManifestContext) kubeControllerManager() { c.addManifestFiles( "kube-controller-manager/kube-controller-manager-deployment.yaml", @@ -286,7 +261,7 @@ func (c *clusterManifestContext) registry() { func (c *clusterManifestContext) clusterBootstrap() { manifests, err := assets.AssetDir("cluster-bootstrap") if err != nil { - panic(err.Error()) + panic(err) } for _, m := range manifests { c.addUserManifestFiles("cluster-bootstrap/" + m) @@ -395,7 +370,7 @@ data: func (c *clusterManifestContext) ignitionConfigs() { manifests, err := assets.AssetDir("ignition-configs") if err != nil { - panic(err.Error()) + panic(err) } for _, m := range manifests { content, err := c.substituteParams(c.params, "ignition-configs/"+m) diff --git a/hypershift-operator/render/controlplane/hypershift/pki/openshift.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/openshift.go similarity index 97% rename from hypershift-operator/render/controlplane/hypershift/pki/openshift.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/openshift.go index a1ef4a748d53..2192b5fb47b4 100644 --- a/hypershift-operator/render/controlplane/hypershift/pki/openshift.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/pki/openshift.go @@ -7,10 +7,10 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - hypershiftcp "openshift.io/hypershift/hypershift-operator/render/controlplane/hypershift" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/render" ) -func GeneratePKI(params *hypershiftcp.PKIParams) (map[string][]byte, error) { +func GeneratePKI(params *render.PKIParams) (map[string][]byte, error) { log.Info("Generating PKI artifacts") cas := []caSpec{ diff --git a/hypershift-operator/render/controlplane/hypershift/pki/spec.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/spec.go similarity index 97% rename from hypershift-operator/render/controlplane/hypershift/pki/spec.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/spec.go index 16cd67f4698f..4bdfd0964fdb 100644 --- a/hypershift-operator/render/controlplane/hypershift/pki/spec.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/pki/spec.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "openshift.io/hypershift/hypershift-operator/render/controlplane/hypershift/pki/util" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/render/pki/util" ) type caSpec struct { diff --git a/hypershift-operator/render/controlplane/hypershift/pki/util/ca.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/util/ca.go similarity index 100% rename from hypershift-operator/render/controlplane/hypershift/pki/util/ca.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/util/ca.go diff --git a/hypershift-operator/render/controlplane/hypershift/pki/util/cert.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/util/cert.go similarity index 100% rename from hypershift-operator/render/controlplane/hypershift/pki/util/cert.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/util/cert.go diff --git a/hypershift-operator/render/controlplane/hypershift/pki/util/file.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/util/file.go similarity index 100% rename from hypershift-operator/render/controlplane/hypershift/pki/util/file.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/util/file.go diff --git a/hypershift-operator/render/controlplane/hypershift/pki/util/kubeconfig.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/util/kubeconfig.go similarity index 100% rename from hypershift-operator/render/controlplane/hypershift/pki/util/kubeconfig.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/util/kubeconfig.go diff --git a/hypershift-operator/render/controlplane/hypershift/pki/util/tls.go b/control-plane-operator/controllers/hostedcontrolplane/render/pki/util/tls.go similarity index 100% rename from hypershift-operator/render/controlplane/hypershift/pki/util/tls.go rename to control-plane-operator/controllers/hostedcontrolplane/render/pki/util/tls.go diff --git a/hypershift-operator/render/controlplane/hypershift/rendercontext.go b/control-plane-operator/controllers/hostedcontrolplane/render/rendercontext.go similarity index 93% rename from hypershift-operator/render/controlplane/hypershift/rendercontext.go rename to control-plane-operator/controllers/hostedcontrolplane/render/rendercontext.go index e60768257eb9..c7e38bcc4247 100644 --- a/hypershift-operator/render/controlplane/hypershift/rendercontext.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/rendercontext.go @@ -1,4 +1,4 @@ -package hypershift +package render import ( "bytes" @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - assets "openshift.io/hypershift/hypershift-operator/assets/controlplane/hypershift" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane/assets" ) type renderContext struct { diff --git a/hypershift-operator/render/controlplane/hypershift/types.go b/control-plane-operator/controllers/hostedcontrolplane/render/types.go similarity index 98% rename from hypershift-operator/render/controlplane/hypershift/types.go rename to control-plane-operator/controllers/hostedcontrolplane/render/types.go index a1de8c3bf12b..540fd9f8f774 100644 --- a/hypershift-operator/render/controlplane/hypershift/types.go +++ b/control-plane-operator/controllers/hostedcontrolplane/render/types.go @@ -1,4 +1,4 @@ -package hypershift +package render import "github.com/google/uuid" @@ -83,7 +83,6 @@ type ClusterParams struct { OpenVPNServerResources []ResourceRequirements `json:"openVPNServerResources"` APIServerAuditEnabled bool `json:"apiServerAuditEnabled"` RestartDate string `json:"restartDate"` - HostedClusterConfigOperatorImage string `json:"hostedClusterConfigOperatorImage"` HostedClusterConfigOperatorControllers []string `json:"hostedClusterConfigOperatorControllers"` ROKSMetricsImage string `json:"roksMetricsImage"` ExtraFeatureGates []string `json:"extraFeatureGates"` diff --git a/control-plane-operator/main.go b/control-plane-operator/main.go new file mode 100644 index 000000000000..e1d0ab7e1209 --- /dev/null +++ b/control-plane-operator/main.go @@ -0,0 +1,176 @@ +package main + +import ( + "context" + "fmt" + "os" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + capiaws "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + "sigs.k8s.io/controller-runtime/pkg/client" + + configv1 "github.com/openshift/api/config/v1" + operatorv1 "github.com/openshift/api/operator/v1" + routev1 "github.com/openshift/api/route/v1" + securityv1 "github.com/openshift/api/security/v1" + "github.com/spf13/cobra" + appsv1client "k8s.io/client-go/kubernetes/typed/apps/v1" + + "k8s.io/apimachinery/pkg/runtime" + clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + + hyperv1 "openshift.io/hypershift/api/v1alpha1" + "openshift.io/hypershift/control-plane-operator/controllers/hostedcontrolplane" + "openshift.io/hypershift/control-plane-operator/releaseinfo" + + capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + // +kubebuilder:scaffold:imports +) + +var ( + scheme = runtime.NewScheme() + setupLog = ctrl.Log.WithName("setup") +) + +func init() { + capiaws.AddToScheme(scheme) + clientgoscheme.AddToScheme(scheme) + hyperv1.AddToScheme(scheme) + capiv1.AddToScheme(scheme) + configv1.AddToScheme(scheme) + securityv1.AddToScheme(scheme) + operatorv1.AddToScheme(scheme) + routev1.AddToScheme(scheme) + // +kubebuilder:scaffold:scheme +} + +func main() { + cmd := &cobra.Command{ + Use: "control-plane-operator", + Run: func(cmd *cobra.Command, args []string) { + cmd.Help() + os.Exit(1) + }, + } + cmd.AddCommand(NewStartCommand()) + + if err := cmd.Execute(); err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) + } +} + +func NewStartCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "run", + Short: "Runs the HyperShift Control Plane Operator", + } + + var namespace string + var deploymentName string + var metricsAddr string + var enableLeaderElection bool + var hostedClusterConfigOperatorImage string + + cmd.Flags().StringVar(&namespace, "namespace", "", "The namespace this operator lives in") + cmd.Flags().StringVar(&deploymentName, "deployment-name", "", "The name of the deployment of this operator") + cmd.Flags().StringVar(&metricsAddr, "metrics-addr", "0", "The address the metric endpoint binds to.") + cmd.Flags().BoolVar(&enableLeaderElection, "enable-leader-election", false, + "Enable leader election for controller manager. "+ + "Enabling this will ensure there is only one active controller manager.") + cmd.Flags().StringVar(&hostedClusterConfigOperatorImage, "hosted-cluster-config-operator-image", "", "A specific operator image.") + cmd.Run = func(cmd *cobra.Command, args []string) { + ctrl.SetLogger(zap.New(zap.UseDevMode(true))) + + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ + Scheme: scheme, + MetricsBindAddress: metricsAddr, + Port: 9443, + LeaderElection: enableLeaderElection, + LeaderElectionID: "b2ed43cb.hypershift.openshift.io", + Namespace: namespace, + // Use a non-caching client everywhere. The default split client does not + // promise to invalidate the cache during writes (nor does it promise + // sequential create/get coherence), and we have code which (probably + // incorrectly) assumes a get immediately following a create/update will + // return the updated resource. All client consumers will need audited to + // ensure they are tolerant of stale data (or we need a cache or client that + // makes stronger coherence guarantees). + NewClient: func(_ cache.Cache, config *rest.Config, options client.Options) (client.Client, error) { + return client.New(config, options) + }, + }) + if err != nil { + setupLog.Error(err, "unable to start manager") + os.Exit(1) + } + + // For now, since the hosted cluster config operator is treated like any other + // release payload component but isn't actually part of a release payload, + // enable the user to specify an image directly as a flag, and otherwise + // try and detect the control plane operator's image to use instead. + kubeClient, err := kubernetes.NewForConfig(mgr.GetConfig()) + if err != nil { + setupLog.Error(err, "unable to create kube client") + os.Exit(1) + } + lookupOperatorImage := func(deployments appsv1client.DeploymentInterface, name string) (string, error) { + if len(hostedClusterConfigOperatorImage) > 0 { + setupLog.Info("using operator image from arguments") + return hostedClusterConfigOperatorImage, nil + } + deployment, err := deployments.Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return "", fmt.Errorf("failed to get operator deployment: %w", err) + } + for _, container := range deployment.Spec.Template.Spec.Containers { + // TODO: could use downward API for this too, overkill? + if container.Name == "control-plane-operator" { + setupLog.Info("using operator image from deployment") + return container.Image, nil + } + } + return "", fmt.Errorf("couldn't locate operator container on deployment") + } + hostedClusterConfigOperatorImage, err := lookupOperatorImage(kubeClient.AppsV1().Deployments(namespace), deploymentName) + if err != nil { + setupLog.Error(err, fmt.Sprintf("failed to find operator image: %s", err), "controller", "hosted-control-plane") + os.Exit(1) + } + setupLog.Info("using operator image", "operator-image", hostedClusterConfigOperatorImage) + + releaseProvider := &releaseinfo.StaticProviderDecorator{ + Delegate: &releaseinfo.PodProvider{ + Pods: kubeClient.CoreV1().Pods(namespace), + }, + ComponentImages: map[string]string{ + "hosted-cluster-config-operator": hostedClusterConfigOperatorImage, + }, + } + + if err := (&hostedcontrolplane.HostedControlPlaneReconciler{ + Client: mgr.GetClient(), + ReleaseProvider: releaseProvider, + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "hosted-control-plane") + os.Exit(1) + } + + // +kubebuilder:scaffold:builder + + setupLog.Info("starting manager") + + if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { + setupLog.Error(err, "problem running manager") + os.Exit(1) + } + } + + return cmd +} diff --git a/control-plane-operator/releaseinfo/pod_provider.go b/control-plane-operator/releaseinfo/pod_provider.go new file mode 100644 index 000000000000..1ec1f5ac447a --- /dev/null +++ b/control-plane-operator/releaseinfo/pod_provider.go @@ -0,0 +1,98 @@ +package releaseinfo + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "time" + + imageapi "github.com/openshift/api/image/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" +) + +var _ Provider = (*PodProvider)(nil) + +// PodProvider finds the release image metadata for an image by launching a pod +// using the image and extracting the serialized ImageStream from the image +// filesystem assumed to be present at /release-manifests/image-references. +type PodProvider struct { + Pods v1.PodInterface + + // TODO: consider something like ExpirationCache if performance becomes an issue +} + +func (p *PodProvider) Lookup(ctx context.Context, image string) (releaseImage *ReleaseImage, err error) { + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "image-lookup", + }, + Spec: corev1.PodSpec{ + RestartPolicy: corev1.RestartPolicyNever, + Containers: []corev1.Container{ + { + Name: "lookup", + Image: image, + Command: []string{"/usr/bin/cat", "/release-manifests/image-references"}, + }, + }, + }, + } + + // Launch the pod and ensure we clean up regardless of outcome + pod, err = p.Pods.Create(context.TODO(), pod, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create image lookup pod: %w", err) + } + defer func() { + err := p.Pods.Delete(ctx, pod.Name, metav1.DeleteOptions{}) + if err != nil { + err = fmt.Errorf("failed to delete image lookup pod %q: %w", pod.Name, err) + } + }() + + // Wait for the pod to reach a terminate state + err = wait.PollImmediateUntil(1*time.Second, func() (bool, error) { + pod, err := p.Pods.Get(ctx, pod.Name, metav1.GetOptions{}) + if err != nil { + return false, err + } + switch pod.Status.Phase { + case corev1.PodSucceeded: + return true, nil + case corev1.PodFailed: + return true, fmt.Errorf("image lookup pod failed") + default: + return false, nil + } + }, ctx.Done()) + if err != nil { + return nil, fmt.Errorf("failed waiting for image lookup pod %q: %w", pod.Name, err) + } + + // Try and extract the pod's logs + req := p.Pods.GetLogs(pod.Name, &corev1.PodLogOptions{}) + logs, err := req.Stream(ctx) + if err != nil { + return nil, fmt.Errorf("failed to read image lookup pod %q logs: %w", pod.Name, err) + } + defer func() { + err := logs.Close() + if err != nil { + err = fmt.Errorf("failed to close pod %q log stream: %w", pod.Name, err) + } + }() + data, err := ioutil.ReadAll(logs) + + // The logs should be a serialized ImageStream resource + var imageStream imageapi.ImageStream + err = json.Unmarshal(data, &imageStream) + if err != nil { + return nil, fmt.Errorf("couldn't read image lookup pod %q logs as a serialized ImageStream: %w\nraw logs:\n%s", pod.Name, err, string(data)) + } + releaseImage = &ReleaseImage{ImageStream: &imageStream} + return +} diff --git a/hypershift-operator/releaseinfo/releaseinfo.go b/control-plane-operator/releaseinfo/releaseinfo.go similarity index 73% rename from hypershift-operator/releaseinfo/releaseinfo.go rename to control-plane-operator/releaseinfo/releaseinfo.go index 96c327e329d7..bb6607ddc320 100644 --- a/hypershift-operator/releaseinfo/releaseinfo.go +++ b/control-plane-operator/releaseinfo/releaseinfo.go @@ -3,22 +3,15 @@ package releaseinfo import ( "bytes" "context" - "encoding/json" "fmt" - "io/ioutil" "regexp" "sort" "strings" - "time" "github.com/blang/semver" imageapi "github.com/openshift/api/image/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - v1 "k8s.io/client-go/kubernetes/typed/core/v1" ) // Provider knows how to find the release image metadata for an image referred @@ -27,90 +20,6 @@ type Provider interface { Lookup(ctx context.Context, image string) (*ReleaseImage, error) } -var _ Provider = (*PodProvider)(nil) - -// PodProvider finds the release image metadata for an image by launching a pod -// using the image and extracting the serialized ImageStream from the image -// filesystem assumed to be present at /release-manifests/image-references. -type PodProvider struct { - Pods v1.PodInterface - - // TODO: consider something like ExpirationCache if performance becomes an issue -} - -func (p *PodProvider) Lookup(ctx context.Context, image string) (releaseImage *ReleaseImage, err error) { - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "hypershift", - GenerateName: "image-lookup", - }, - Spec: corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - Containers: []corev1.Container{ - { - Name: "lookup", - Image: image, - Command: []string{"/usr/bin/cat", "/release-manifests/image-references"}, - }, - }, - }, - } - - // Launch the pod and ensure we clean up regardless of outcome - pod, err = p.Pods.Create(context.TODO(), pod, metav1.CreateOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to create image lookup pod: %w", err) - } - defer func() { - err := p.Pods.Delete(ctx, pod.Name, metav1.DeleteOptions{}) - if err != nil { - err = fmt.Errorf("failed to delete image lookup pod %q: %w", pod.Name, err) - } - }() - - // Wait for the pod to reach a terminate state - err = wait.PollImmediateUntil(1*time.Second, func() (bool, error) { - pod, err := p.Pods.Get(ctx, pod.Name, metav1.GetOptions{}) - if err != nil { - return false, err - } - switch pod.Status.Phase { - case corev1.PodSucceeded: - return true, nil - case corev1.PodFailed: - return true, fmt.Errorf("image lookup pod failed") - default: - return false, nil - } - }, ctx.Done()) - if err != nil { - return nil, fmt.Errorf("failed waiting for image lookup pod %q: %w", pod.Name, err) - } - - // Try and extract the pod's logs - req := p.Pods.GetLogs(pod.Name, &corev1.PodLogOptions{}) - logs, err := req.Stream(ctx) - if err != nil { - return nil, fmt.Errorf("failed to read image lookup pod %q logs: %w", pod.Name, err) - } - defer func() { - err := logs.Close() - if err != nil { - err = fmt.Errorf("failed to close pod %q log stream: %w", pod.Name, err) - } - }() - data, err := ioutil.ReadAll(logs) - - // The logs should be a serialized ImageStream resource - var imageStream imageapi.ImageStream - err = json.Unmarshal(data, &imageStream) - if err != nil { - return nil, fmt.Errorf("couldn't read image lookup pod %q logs as a serialized ImageStream: %w\nraw logs:\n%s", pod.Name, err, string(data)) - } - releaseImage = &ReleaseImage{ImageStream: &imageStream} - return -} - // ReleaseImage wraps an ImageStream with some utilities that help the user // discover constituent component image information. type ReleaseImage struct { diff --git a/control-plane-operator/releaseinfo/static_provider.go b/control-plane-operator/releaseinfo/static_provider.go new file mode 100644 index 000000000000..2e7b1cdd193b --- /dev/null +++ b/control-plane-operator/releaseinfo/static_provider.go @@ -0,0 +1,45 @@ +package releaseinfo + +import ( + "context" + "sync" + + imageapi "github.com/openshift/api/image/v1" + corev1 "k8s.io/api/core/v1" +) + +var _ Provider = (*StaticProviderDecorator)(nil) + +// StaticProviderDecorator decorates another Provider to add user-specified +// component name to image mappings. The Lookup implementation will first +// delegate to the given Delegate, and will then add additional TagReferences +// to the Delegate's results based on the ComponentImages. +type StaticProviderDecorator struct { + Delegate Provider + ComponentImages map[string]string + + lock sync.Mutex +} + +func (p *StaticProviderDecorator) Lookup(ctx context.Context, image string) (*ReleaseImage, error) { + p.lock.Lock() + defer p.lock.Unlock() + + releaseImage, err := p.Delegate.Lookup(ctx, image) + if err != nil { + return nil, err + } + if p.ComponentImages == nil { + return releaseImage, nil + } + for component, image := range p.ComponentImages { + ref := imageapi.TagReference{ + Name: component, + From: &corev1.ObjectReference{ + Name: image, + }, + } + releaseImage.Spec.Tags = append(releaseImage.Spec.Tags, ref) + } + return releaseImage, nil +} diff --git a/hypershift-operator/assets/controlplane/hypershift/hypershift-operator/hypershift-operator-configmap.yaml b/hypershift-operator/assets/controlplane/hypershift/hypershift-operator/hypershift-operator-configmap.yaml deleted file mode 100644 index 5d90bbf5c802..000000000000 --- a/hypershift-operator/assets/controlplane/hypershift/hypershift-operator/hypershift-operator-configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: hypershift-operator -data: - initial-ca.crt: | -{{ include_pki "combined-ca.crt" 4 }} diff --git a/hypershift-operator/controllers/controlplane.go b/hypershift-operator/controllers/controlplane.go deleted file mode 100644 index 63d063d658d0..000000000000 --- a/hypershift-operator/controllers/controlplane.go +++ /dev/null @@ -1,553 +0,0 @@ -package controllers - -import ( - "bytes" - "context" - crand "crypto/rand" - "encoding/base64" - "encoding/hex" - "fmt" - "hash/fnv" - "io" - "math/big" - "math/rand" - "os" - "strings" - - "github.com/go-logr/logr" - - "sigs.k8s.io/cluster-api/util" - - "github.com/blang/semver" - log "github.com/sirupsen/logrus" - "golang.org/x/crypto/bcrypt" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/yaml" - client "sigs.k8s.io/controller-runtime/pkg/client" - - hyperv1 "openshift.io/hypershift/api/v1alpha1" - "openshift.io/hypershift/hypershift-operator/releaseinfo" - hypershiftcp "openshift.io/hypershift/hypershift-operator/render/controlplane/hypershift" - "openshift.io/hypershift/hypershift-operator/render/controlplane/hypershift/pki" -) - -const ( - externalOauthPort = 8443 - APIServerPort = 6443 - DefaultAPIServerIPAddress = "172.20.0.1" - oauthBrandingManifest = "v4-0-config-system-branding.yaml" -) - -var ( - excludeManifests = sets.NewString( - "openshift-apiserver-service.yaml", - "v4-0-config-system-branding.yaml", - "oauth-server-service.yaml", - "kube-apiserver-service.yaml", - ) - - version46 = semver.MustParse("4.6.0") -) - -func (r *HostedControlPlaneReconciler) generateControlPlaneManifests(ctx context.Context, hcp *hyperv1.HostedControlPlane, infraStatus InfrastructureStatus, releaseImage *releaseinfo.ReleaseImage) (map[string][]byte, error) { - targetNamespace := hcp.GetName() - - hostedClusterConfigOperatorImage, err := r.LookupHostedClusterConfigOperatorImage(r.Client) - if err != nil { - return nil, fmt.Errorf("failed to lookup hosted cluster config operator image: %w", err) - } - var sshKeySecret corev1.Secret - err = r.Client.Get(ctx, client.ObjectKey{Namespace: hcp.Namespace, Name: hcp.Spec.SSHKey.Name}, &sshKeySecret) - if err != nil { - return nil, fmt.Errorf("failed to get SSH key secret %s: %w", hcp.Spec.SSHKey.Name, err) - } - sshKeyData, hasSSHKeyData := sshKeySecret.Data["id_rsa.pub"] - if !hasSSHKeyData { - return nil, fmt.Errorf("SSH key secret secret %s is missing the id_rsa.pub key", hcp.Spec.SSHKey.Name) - } - baseDomain, err := ClusterBaseDomain(r.Client, ctx, hcp.Name) - if err != nil { - return nil, fmt.Errorf("couldn't determine cluster base domain name: %w", err) - } - - params := hypershiftcp.NewClusterParams() - params.Namespace = targetNamespace - params.ExternalAPIDNSName = infraStatus.APIAddress - params.ExternalAPIPort = APIServerPort - params.ExternalAPIAddress = DefaultAPIServerIPAddress - params.ExternalOpenVPNAddress = infraStatus.VPNAddress - params.ExternalOpenVPNPort = 1194 - params.ExternalOauthDNSName = infraStatus.OAuthAddress - params.ExternalOauthPort = externalOauthPort - params.ServiceCIDR = hcp.Spec.ServiceCIDR - params.PodCIDR = hcp.Spec.PodCIDR - params.ReleaseImage = hcp.Spec.ReleaseImage - params.IngressSubdomain = fmt.Sprintf("apps.%s", baseDomain) - params.OpenShiftAPIClusterIP = infraStatus.OpenShiftAPIAddress - params.OauthAPIClusterIP = infraStatus.OauthAPIServerAddress - params.BaseDomain = baseDomain - params.MachineConfigServerAddress = infraStatus.IgnitionProviderAddress - params.CloudProvider = string(r.Infra.Status.PlatformStatus.Type) - params.PlatformType = string(r.Infra.Status.PlatformStatus.Type) - params.InternalAPIPort = APIServerPort - params.EtcdClientName = "etcd-client" - params.NetworkType = "OpenShiftSDN" - params.ImageRegistryHTTPSecret = generateImageRegistrySecret() - params.Replicas = "1" - params.SSHKey = string(sshKeyData) - params.HostedClusterConfigOperatorImage = hostedClusterConfigOperatorImage - params.HypershiftOperatorControllers = []string{"route-sync", "auto-approver", "kubeadmin-password", "node"} - - // Generate PKI data just once and store it in a secret. PKI generation isn't - // deterministic and shouldn't be performed with every reconcile, otherwise - // we're effectively doing an uncontrolled cert rotation each generation. - pkiSecret := &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: targetNamespace, - Name: "pki", - }, - Data: map[string][]byte{}, - } - needsPkiSecret := false - if err := r.Get(ctx, client.ObjectKeyFromObject(pkiSecret), pkiSecret); err != nil { - if apierrors.IsNotFound(err) { - needsPkiSecret = true - } else { - return nil, fmt.Errorf("failed to get pki secret: %w", err) - } - } else { - r.Log.Info("using existing pki secret") - } - if needsPkiSecret { - pkiParams := &hypershiftcp.PKIParams{ - ExternalAPIAddress: infraStatus.APIAddress, - NodeInternalAPIServerIP: DefaultAPIServerIPAddress, - ExternalAPIPort: APIServerPort, - InternalAPIPort: APIServerPort, - ServiceCIDR: hcp.Spec.ServiceCIDR, - ExternalOauthAddress: infraStatus.OAuthAddress, - IngressSubdomain: "apps." + baseDomain, - MachineConfigServerAddress: infraStatus.IgnitionProviderAddress, - ExternalOpenVPNAddress: infraStatus.VPNAddress, - Namespace: targetNamespace, - } - log.Info("generating PKI secret data") - data, err := pki.GeneratePKI(pkiParams) - if err != nil { - return nil, fmt.Errorf("failed to generate PKI data: %w", err) - } - pkiSecret.Data = data - if err := r.Create(ctx, pkiSecret); err != nil { - return nil, fmt.Errorf("failed to create pki secret: %w", err) - } - r.Log.Info("created pki secret") - } - - caBytes := pkiSecret.Data["combined-ca.crt"] - if err != nil { - return nil, fmt.Errorf("failed to read combined CA: %w", err) - } - params.OpenshiftAPIServerCABundle = base64.StdEncoding.EncodeToString(caBytes) - params.OauthAPIServerCABundle = params.OpenshiftAPIServerCABundle - - var pullSecret corev1.Secret - if err := r.Client.Get(ctx, client.ObjectKey{Namespace: hcp.GetNamespace(), Name: hcp.Spec.PullSecret.Name}, &pullSecret); err != nil { - return nil, fmt.Errorf("failed to get pull secret %s: %w", hcp.Spec.PullSecret.Name, err) - } - pullSecretData, hasPullSecretData := pullSecret.Data[".dockerconfigjson"] - if !hasPullSecretData { - return nil, fmt.Errorf("pull secret %s is missing the .dockerconfigjson key", hcp.Spec.PullSecret.Name) - } - manifests, err := hypershiftcp.RenderClusterManifests(params, releaseImage, pullSecretData, pkiSecret.Data) - if err != nil { - return nil, fmt.Errorf("failed to render hypershift manifests for cluster: %w", err) - } - return manifests, nil -} - -func (r *HostedControlPlaneReconciler) ensureControlPlane(ctx context.Context, hcp *hyperv1.HostedControlPlane, infraStatus InfrastructureStatus, releaseImage *releaseinfo.ReleaseImage) error { - r.Log.Info("ensuring control plane for cluster", "cluster", hcp.Name) - - targetNamespace := hcp.GetName() - version, err := semver.Parse(releaseImage.Version()) - if err != nil { - return fmt.Errorf("cannot parse release version (%s): %v", releaseImage.Version(), err) - } - - // Create the configmap with the pull secret for the guest cluster - var pullSecret corev1.Secret - if err := r.Client.Get(ctx, client.ObjectKey{Namespace: targetNamespace, Name: pullSecretName}, &pullSecret); err != nil { - return fmt.Errorf("failed to get pull secret %s: %w", pullSecretName, err) - } - pullSecretData, hasPullSecretData := pullSecret.Data[".dockerconfigjson"] - if !hasPullSecretData { - return fmt.Errorf("pull secret %s is missing the .dockerconfigjson key", pullSecretName) - } - targetPullSecret, err := generateTargetPullSecret(r.Scheme(), pullSecretData, targetNamespace) - if err != nil { - return fmt.Errorf("failed to create pull secret manifest for target cluster: %w", err) - } - if err := r.Create(ctx, targetPullSecret); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to generate targetPullSecret: %v", err) - } - - manifests, err := r.generateControlPlaneManifests(ctx, hcp, infraStatus, releaseImage) - if err != nil { - return err - } - - // Create oauth branding manifest because it cannot be applied - manifestBytes := manifests[oauthBrandingManifest] - manifestObj := &unstructured.Unstructured{} - if err := yaml.NewYAMLOrJSONDecoder(strings.NewReader(string(manifestBytes)), 100).Decode(manifestObj); err != nil { - return fmt.Errorf("failed to decode manifest %s: %w", oauthBrandingManifest, err) - } - manifestObj.SetNamespace(targetNamespace) - if err = r.Create(context.TODO(), manifestObj); err != nil { - if !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to apply manifest %s: %w", oauthBrandingManifest, err) - } - } - - if err := applyManifests(ctx, r, r.Log, targetNamespace, manifests); err != nil { - return err - } - r.Log.Info("successfully applied all manifests") - - userDataSecret := generateUserDataSecret(hcp.GetName(), hcp.GetNamespace(), infraStatus.IgnitionProviderAddress, version) - if err := r.Create(ctx, userDataSecret); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to generate user data secret: %w", err) - } - userDataSecret.OwnerReferences = ensureHCPOwnerRef(hcp, userDataSecret.OwnerReferences) - - kubeadminPassword, err := generateKubeadminPassword() - if err != nil { - return fmt.Errorf("failed to generate kubeadmin password: %w", err) - } - - kubeadminPasswordTargetSecret, err := generateKubeadminPasswordTargetSecret(r.Scheme(), kubeadminPassword, targetNamespace) - if err != nil { - return fmt.Errorf("failed to create kubeadmin secret manifest for target cluster: %w", err) - } - kubeadminPasswordTargetSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeadminPasswordTargetSecret.OwnerReferences) - if err := r.Create(ctx, kubeadminPasswordTargetSecret); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to generate kubeadminPasswordTargetSecret: %w", err) - } - - kubeadminPasswordSecret := generateKubeadminPasswordSecret(targetNamespace, kubeadminPassword) - kubeadminPasswordSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeadminPasswordSecret.OwnerReferences) - if err := r.Create(ctx, kubeadminPasswordSecret); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to generate kubeadminPasswordSecret: %w", err) - } - - pkiSecret := &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: targetNamespace, - Name: "pki", - }, - Data: map[string][]byte{}, - } - if err := r.Get(ctx, client.ObjectKeyFromObject(pkiSecret), pkiSecret); err != nil { - return fmt.Errorf("failed to get pki secret: %w", err) - } - - kubeconfigSecret, err := generateKubeconfigSecret(hcp.GetName(), hcp.GetNamespace(), pkiSecret.Data["admin.kubeconfig"]) - if err != nil { - return fmt.Errorf("failed to create kubeconfig secret manifest for management cluster: %w", err) - } - kubeconfigSecret.OwnerReferences = ensureHCPOwnerRef(hcp, kubeconfigSecret.OwnerReferences) - if err := r.Create(ctx, kubeconfigSecret); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to generate kubeconfigSecret: %w", err) - } - - baseDomain, err := ClusterBaseDomain(r.Client, ctx, hcp.Name) - if err != nil { - return fmt.Errorf("couldn't determine cluster base domain name: %w", err) - } - log.Infof("Cluster API URL: %s", fmt.Sprintf("https://%s:%d", infraStatus.APIAddress, APIServerPort)) - log.Infof("Kubeconfig is available in secret %q in the %s namespace", fmt.Sprintf("%s-kubeconfig", targetNamespace), hcp.GetNamespace()) - log.Infof("Console URL: %s", fmt.Sprintf("https://console-openshift-console.%s", fmt.Sprintf("apps.%s", baseDomain))) - log.Infof("kubeadmin password is available in secret %q in the %s namespace", "kubeadmin-password", targetNamespace) - - return nil -} - -func ensureHCPOwnerRef(hcp *hyperv1.HostedControlPlane, ownerReferences []metav1.OwnerReference) []metav1.OwnerReference { - return util.EnsureOwnerRef(ownerReferences, metav1.OwnerReference{ - APIVersion: hyperv1.GroupVersion.String(), - Kind: "HostedControlPlane", - Name: hcp.GetName(), - UID: hcp.UID, - }) -} -func applyManifests(ctx context.Context, c client.Client, log logr.Logger, namespace string, manifests map[string][]byte) error { - // Use server side apply for manifestss - applyErrors := []error{} - for manifestName, manifestBytes := range manifests { - if excludeManifests.Has(manifestName) { - continue - } - obj := &unstructured.Unstructured{} - if err := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(manifestBytes), 100).Decode(obj); err != nil { - applyErrors = append(applyErrors, fmt.Errorf("failed to decode manifest %s: %w", manifestName, err)) - } - obj.SetNamespace(namespace) - err := c.Patch(ctx, obj, client.RawPatch(types.ApplyPatchType, manifestBytes), client.ForceOwnership, client.FieldOwner("hypershift-operator")) - if err != nil { - applyErrors = append(applyErrors, fmt.Errorf("failed to apply manifest %s: %w", manifestName, err)) - } else { - log.Info("applied manifest", "manifest", manifestName) - } - } - if errs := errors.NewAggregate(applyErrors); errs != nil { - return fmt.Errorf("failed to apply some manifests: %w", errs) - } - return nil -} - -func deleteManifests(ctx context.Context, c client.Client, log logr.Logger, namespace string, manifests map[string][]byte) error { - // Use server side apply for manifestss - applyErrors := []error{} - for manifestName, manifestBytes := range manifests { - if excludeManifests.Has(manifestName) { - continue - } - obj := &unstructured.Unstructured{} - if err := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(manifestBytes), 100).Decode(obj); err != nil { - applyErrors = append(applyErrors, fmt.Errorf("failed to decode manifest %s: %w", manifestName, err)) - } - obj.SetNamespace(namespace) - err := c.Delete(ctx, obj) - if err != nil && !apierrors.IsNotFound(err) && !meta.IsNoMatchError(err) { - applyErrors = append(applyErrors, fmt.Errorf("failed to delete manifest %s: %w", manifestName, err)) - } else { - log.Info("deleted manifest", "manifest", manifestName) - } - } - if errs := errors.NewAggregate(applyErrors); errs != nil { - return fmt.Errorf("failed to delete some manifests: %w", errs) - } - return nil -} - -func generateSSHSecret(data []byte, namespace string) (*corev1.Secret, error) { - secret := &corev1.Secret{} - secret.Name = sshKeySecretName - secret.Namespace = namespace - secret.Data = map[string][]byte{"id_rsa.pub": data} - secret.Type = corev1.SecretTypeOpaque - return secret, nil -} - -func generateProviderCredsSecret(data []byte, namespace string) (*corev1.Secret, error) { - secret := &corev1.Secret{} - secret.Name = providerCredsSecretName - secret.Namespace = namespace - secret.Data = map[string][]byte{"credentials": data} - secret.Type = corev1.SecretTypeOpaque - return secret, nil -} - -func generateTargetPullSecret(scheme *runtime.Scheme, data []byte, namespace string) (*corev1.ConfigMap, error) { - secret := &corev1.Secret{} - secret.Name = "pull-secret" - secret.Namespace = "openshift-config" - secret.Data = map[string][]byte{".dockerconfigjson": data} - secret.Type = corev1.SecretTypeDockerConfigJson - secretBytes, err := runtime.Encode(serializer.NewCodecFactory(scheme).LegacyCodec(corev1.SchemeGroupVersion), secret) - if err != nil { - return nil, err - } - configMap := &corev1.ConfigMap{} - configMap.Namespace = namespace - configMap.Name = "user-manifest-pullsecret" - configMap.Data = map[string]string{"data": string(secretBytes)} - return configMap, nil -} - -func generateUserDataSecret(name, namespace string, ignitionProviderAddr string, version semver.Version) *corev1.Secret { - secret := &corev1.Secret{} - secret.Name = fmt.Sprintf("%s-user-data", name) - secret.Namespace = namespace - - disableTemplatingValue := []byte(base64.StdEncoding.EncodeToString([]byte("true"))) - var userDataValue []byte - - // Clear any version modifiers for this comparison - version.Pre = nil - version.Build = nil - if version.GTE(version46) { - userDataValue = []byte(fmt.Sprintf(`{"ignition":{"config":{"merge":[{"source":"http://%s/config/master","verification":{}}]},"security":{},"timeouts":{},"version":"3.1.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}`, ignitionProviderAddr)) - } else { - userDataValue = []byte(fmt.Sprintf(`{"ignition":{"config":{"append":[{"source":"http://%s/config/master","verification":{}}]},"security":{},"timeouts":{},"version":"2.2.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}`, ignitionProviderAddr)) - } - - secret.Data = map[string][]byte{ - "disableTemplating": disableTemplatingValue, - "value": userDataValue, - } - return secret -} - -func copyFile(src, dest string) error { - in, err := os.Open(src) - if err != nil { - return err - } - defer in.Close() - out, err := os.Create(dest) - if err != nil { - return err - } - defer out.Close() - _, err = io.Copy(out, in) - return err -} - -func generateKubeadminPasswordTargetSecret(scheme *runtime.Scheme, password string, namespace string) (*corev1.ConfigMap, error) { - secret := &corev1.Secret{} - secret.APIVersion = "v1" - secret.Kind = "Secret" - secret.Name = "kubeadmin" - secret.Namespace = "kube-system" - passwordHash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) - if err != nil { - return nil, err - } - secret.Data = map[string][]byte{"kubeadmin": passwordHash} - - secretBytes, err := runtime.Encode(serializer.NewCodecFactory(scheme).LegacyCodec(corev1.SchemeGroupVersion), secret) - if err != nil { - return nil, err - } - configMap := &corev1.ConfigMap{} - configMap.Namespace = namespace - configMap.Name = "user-manifest-kubeadmin-password" - configMap.Data = map[string]string{"data": string(secretBytes)} - return configMap, nil -} - -func generateKubeadminPasswordSecret(namespace, password string) *corev1.Secret { - secret := &corev1.Secret{} - secret.Namespace = namespace - secret.Name = "kubeadmin-password" - secret.Data = map[string][]byte{"password": []byte(password)} - return secret -} - -func generateKubeconfigSecret(name, namespace string, kubeconfigBytes []byte) (*corev1.Secret, error) { - secret := &corev1.Secret{} - secret.Namespace = namespace - secret.Name = fmt.Sprintf("%s-kubeconfig", name) - secret.Data = map[string][]byte{"value": kubeconfigBytes} - return secret, nil -} - -func generateImageRegistrySecret() string { - num := make([]byte, 64) - rand.Read(num) - return hex.EncodeToString(num) -} - -func generateKubeadminPassword() (string, error) { - const ( - lowerLetters = "abcdefghijkmnopqrstuvwxyz" - upperLetters = "ABCDEFGHIJKLMNPQRSTUVWXYZ" - digits = "23456789" - all = lowerLetters + upperLetters + digits - length = 23 - ) - var password string - for i := 0; i < length; i++ { - n, err := crand.Int(crand.Reader, big.NewInt(int64(len(all)))) - if err != nil { - return "", err - } - newchar := string(all[n.Int64()]) - if password == "" { - password = newchar - } - if i < length-1 { - n, err = crand.Int(crand.Reader, big.NewInt(int64(len(password)+1))) - if err != nil { - return "", err - } - j := n.Int64() - password = password[0:j] + newchar + password[j:] - } - } - pw := []rune(password) - for _, replace := range []int{5, 11, 17} { - pw[replace] = '-' - } - return string(pw), nil -} - -func generateMachineSetName(infraName, clusterName, suffix string) string { - return getName(fmt.Sprintf("%s-%s", infraName, clusterName), suffix, 43) -} - -// getName returns a name given a base ("deployment-5") and a suffix ("deploy") -// It will first attempt to join them with a dash. If the resulting name is longer -// than maxLength: if the suffix is too long, it will truncate the base name and add -// an 8-character hash of the [base]-[suffix] string. If the suffix is not too long, -// it will truncate the base, add the hash of the base and return [base]-[hash]-[suffix] -func getName(base, suffix string, maxLength int) string { - if maxLength <= 0 { - return "" - } - name := fmt.Sprintf("%s-%s", base, suffix) - if len(name) <= maxLength { - return name - } - - // length of -hash- - baseLength := maxLength - 10 - len(suffix) - - // if the suffix is too long, ignore it - if baseLength < 0 { - prefix := base[0:min(len(base), max(0, maxLength-9))] - // Calculate hash on initial base-suffix string - shortName := fmt.Sprintf("%s-%s", prefix, hash(name)) - return shortName[:min(maxLength, len(shortName))] - } - - prefix := base[0:baseLength] - // Calculate hash on initial base-suffix string - return fmt.Sprintf("%s-%s-%s", prefix, hash(base), suffix) -} - -// max returns the greater of its 2 inputs -func max(a, b int) int { - if b > a { - return b - } - return a -} - -// min returns the lesser of its 2 inputs -func min(a, b int) int { - if b < a { - return b - } - return a -} - -// hash calculates the hexadecimal representation (8-chars) -// of the hash of the passed in string using the FNV-a algorithm -func hash(s string) string { - hash := fnv.New32a() - hash.Write([]byte(s)) - intHash := hash.Sum32() - result := fmt.Sprintf("%08x", intHash) - return result -} diff --git a/hypershift-operator/controllers/externalinfracluster_controller.go b/hypershift-operator/controllers/externalinfracluster/externalinfracluster_controller.go similarity index 99% rename from hypershift-operator/controllers/externalinfracluster_controller.go rename to hypershift-operator/controllers/externalinfracluster/externalinfracluster_controller.go index 44aaa71efbca..112245607605 100644 --- a/hypershift-operator/controllers/externalinfracluster_controller.go +++ b/hypershift-operator/controllers/externalinfracluster/externalinfracluster_controller.go @@ -1,4 +1,4 @@ -package controllers +package externalinfracluster import ( "context" diff --git a/hypershift-operator/controllers/helpers.go b/hypershift-operator/controllers/helpers.go deleted file mode 100644 index 9232bb5c5ced..000000000000 --- a/hypershift-operator/controllers/helpers.go +++ /dev/null @@ -1,19 +0,0 @@ -package controllers - -import ( - "context" - "fmt" - - configv1 "github.com/openshift/api/config/v1" - ctrl "sigs.k8s.io/controller-runtime/pkg/client" -) - -// TODO: base domain isn't actually part of our API -func ClusterBaseDomain(client ctrl.Client, ctx context.Context, clusterName string) (string, error) { - var dnsConfig configv1.DNS - err := client.Get(ctx, ctrl.ObjectKey{Name: "cluster"}, &dnsConfig) - if err != nil { - return "", fmt.Errorf("failed to get cluster dns config: %w", err) - } - return fmt.Sprintf("%s.%s", clusterName, dnsConfig.Spec.BaseDomain), nil -} diff --git a/hypershift-operator/controllers/hosted_controlplane_controller.go b/hypershift-operator/controllers/hosted_controlplane_controller.go deleted file mode 100644 index 753e74a24c14..000000000000 --- a/hypershift-operator/controllers/hosted_controlplane_controller.go +++ /dev/null @@ -1,184 +0,0 @@ -package controllers - -import ( - "context" - "fmt" - "time" - - "github.com/go-logr/logr" - configv1 "github.com/openshift/api/config/v1" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/workqueue" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - - hyperv1 "openshift.io/hypershift/api/v1alpha1" - "openshift.io/hypershift/hypershift-operator/releaseinfo" -) - -type HostedControlPlaneReconciler struct { - client.Client - Log logr.Logger - Infra *configv1.Infrastructure - recorder record.EventRecorder - LookupHostedClusterConfigOperatorImage func(kubeClient client.Client) (string, error) - ReleaseProvider releaseinfo.Provider -} - -func (r *HostedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error { - _, err := ctrl.NewControllerManagedBy(mgr). - For(&hyperv1.HostedControlPlane{}). - WithOptions(controller.Options{ - RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second), - }). - Build(r) - if err != nil { - return errors.Wrap(err, "failed setting up with a controller manager") - } - - var infra configv1.Infrastructure - if err := mgr.GetAPIReader().Get(context.Background(), client.ObjectKey{Name: "cluster"}, &infra); err != nil { - return fmt.Errorf("failed to get cluster infra: %w", err) - } - r.Infra = &infra - - r.recorder = mgr.GetEventRecorderFor("hosted-control-plane-controller") - - return nil -} - -func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - r.Log = ctrl.LoggerFrom(ctx) - r.Log.Info("Reconciling") - - // Fetch the hostedControlPlane instance - hostedControlPlane := &hyperv1.HostedControlPlane{} - err := r.Client.Get(ctx, req.NamespacedName, hostedControlPlane) - if err != nil { - if apierrors.IsNotFound(err) { - return ctrl.Result{}, nil - } - return ctrl.Result{}, err - } - - // Fetch the Cluster. - cluster, err := util.GetOwnerCluster(ctx, r.Client, hostedControlPlane.ObjectMeta) - if err != nil { - return ctrl.Result{}, err - } - - if cluster == nil { - r.Log.Info("Cluster Controller has not yet set OwnerRef") - return ctrl.Result{}, nil - } - - if util.IsPaused(cluster, hostedControlPlane) { - r.Log.Info("HostedControlPlane or linked Cluster is marked as paused. Won't reconcile") - return ctrl.Result{}, nil - } - - // Return early if deleted - if !hostedControlPlane.DeletionTimestamp.IsZero() { - if err := r.delete(ctx, hostedControlPlane); err != nil { - r.Log.Error(err, "failed to delete cluster") - return ctrl.Result{}, err - } - if controllerutil.ContainsFinalizer(hostedControlPlane, finalizer) { - controllerutil.RemoveFinalizer(hostedControlPlane, finalizer) - if err := r.Update(ctx, hostedControlPlane); err != nil { - return ctrl.Result{}, fmt.Errorf("failed to remove finalizer from cluster: %w", err) - } - } - return ctrl.Result{}, nil - } - - // Ensure the hostedControlPlane has a finalizer for cleanup - if !controllerutil.ContainsFinalizer(hostedControlPlane, finalizer) { - controllerutil.AddFinalizer(hostedControlPlane, finalizer) - if err := r.Update(ctx, hostedControlPlane); err != nil { - return ctrl.Result{}, fmt.Errorf("failed to add finalizer to hostedControlPlane: %w", err) - } - } - - r.Log = r.Log.WithValues("cluster", cluster.Name) - - patchHelper, err := patch.NewHelper(hostedControlPlane, r.Client) - if err != nil { - return ctrl.Result{}, fmt.Errorf("failed to init patch helper: %w", err) - } - - var result ctrl.Result - // TODO (alberto): - // May be eventually just run a deployment with a CVO running a hostedControlPlane profile - // passing the hostedControlPlane.spec.version through? - - if hostedControlPlane.Status.Ready { - r.Log.Info("Is ready") - return result, nil - } - - r.Log.Info("Creating API services") - infraStatus, err := r.ensureInfrastructure(ctx, hostedControlPlane) - if err != nil { - r.Log.Error(err, "failed to ensure infrastructure") - return result, fmt.Errorf("failed to ensure infrastructure: %w", err) - } - - // Wait for things like LB services to become available - if !infraStatus.IsReady() { - result.RequeueAfter = 5 * time.Second - r.Log.Info("Cluster infrastructure is still provisioning, will try again later") - return result, nil - } - hostedControlPlane.Status.ControlPlaneEndpoint = hyperv1.APIEndpoint{ - Host: infraStatus.APIAddress, - Port: APIServerPort, - } - - releaseImage, err := r.ReleaseProvider.Lookup(ctx, hostedControlPlane.Spec.ReleaseImage) - if err != nil { - return ctrl.Result{}, fmt.Errorf("failed to look up release info: %w", err) - } - componentVersions, err := releaseImage.ComponentVersions() - if err != nil { - return ctrl.Result{}, fmt.Errorf("invalid component versions found in release info: %w", err) - } - r.Log.Info("found release info for image", "releaseImage", hostedControlPlane.Spec.ReleaseImage, "info", releaseImage, "componentImages", releaseImage.ComponentImages(), "componentVersions", componentVersions) - - // Install the control plane into the infrastructure - r.Log.Info("Creating hosted control plane") - err = r.ensureControlPlane(ctx, hostedControlPlane, infraStatus, releaseImage) - if err != nil { - r.Log.Error(err, "failed to ensure control plane") - return result, fmt.Errorf("failed to ensure control plane: %w", err) - } - - hostedControlPlane.Status.Ready = true - if err := patchHelper.Patch(ctx, hostedControlPlane); err != nil { - return ctrl.Result{}, fmt.Errorf("failed to patch: %w", err) - } - - r.Log.Info("Successfully reconciled") - return ctrl.Result{}, nil -} - -func (r *HostedControlPlaneReconciler) delete(ctx context.Context, hcp *hyperv1.HostedControlPlane) error { - releaseImage, err := r.ReleaseProvider.Lookup(ctx, hcp.Spec.ReleaseImage) - if err != nil { - return fmt.Errorf("failed to look up release info: %w", err) - } - manifests, err := r.generateControlPlaneManifests(ctx, hcp, InfrastructureStatus{}, releaseImage) - if err != nil { - return nil - } - if err := deleteManifests(ctx, r, r.Log, hcp.GetName(), manifests); err != nil { - return err - } - return nil -} diff --git a/hypershift-operator/controllers/hostedcluster/assets/bindata.go b/hypershift-operator/controllers/hostedcluster/assets/bindata.go new file mode 100644 index 000000000000..4111bebcd89e --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/assets/bindata.go @@ -0,0 +1,531 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrole.yaml (2.963kB) +// hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrolebinding.yaml (303B) +// hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-deployment.yaml (1.378kB) +// hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-serviceaccount.yaml (77B) +// hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrole.yaml (1.113kB) +// hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrolebinding.yaml (266B) +// hypershift-operator/controllers/hostedcluster/assets/capi/manager-deployment.yaml (516B) +// hypershift-operator/controllers/hostedcluster/assets/capi/manager-serviceaccount.yaml (66B) +// hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-deployment.yaml (718B) +// hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-role.yaml (1.398kB) +// hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-rolebinding.yaml (299B) +// hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-serviceaccount.yaml (77B) + +package assets + +import ( + "bytes" + "compress/gzip" + "crypto/sha256" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) + +func bindataRead(data []byte, name string) ([]byte, error) { + gz, err := gzip.NewReader(bytes.NewBuffer(data)) + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + + var buf bytes.Buffer + _, err = io.Copy(&buf, gz) + clErr := gz.Close() + + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + if clErr != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +type asset struct { + bytes []byte + info os.FileInfo + digest [sha256.Size]byte +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _capiCapaManagerClusterroleYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x94\xc1\x6e\xa3\x40\x0c\x86\xef\x3c\xc5\x28\x17\xa4\x48\x10\xed\x6d\xc5\x75\x0f\x7b\x5f\xad\x7a\x77\x06\x27\x8c\x32\xcc\x8c\x6c\x4f\x92\xf6\xe9\xab\x40\x94\xd2\x12\x54\xd2\x92\x36\x0d\xa7\xb1\xcd\x2f\x3e\xff\x63\x0c\xc1\x3c\x20\xb1\xf1\xae\x50\xb4\x04\x9d\x43\x94\xca\x93\x79\x02\x31\xde\xe5\x9b\xdf\x9c\x1b\xbf\xd8\xfe\x4a\x36\xc6\x95\x85\xfa\x63\x23\x0b\xd2\x3f\x6f\x31\xa9\x51\xa0\x04\x81\x22\x51\x4a\x13\x36\x82\xff\xa6\x46\x16\xa8\x43\xa1\x5c\xb4\x36\x51\xca\x41\x8d\x85\xd2\x10\x20\xab\xc1\xc1\x1a\x29\xa3\x83\x9a\xa2\x45\x3e\x48\x33\x05\xc1\xfc\x25\x1f\x43\x13\x1e\x9e\x4c\xcd\x66\xcd\x91\x90\x7d\x24\x8d\x9d\x0a\x6e\xd1\x09\x37\xe1\x16\x69\xd9\xa9\x34\x0c\x78\x0a\xd7\x28\xa7\xb3\x35\xfc\x12\x04\x10\x5d\x9d\xa2\x18\xca\xae\x6a\x77\x2c\x5e\x48\xc5\xa8\x09\x47\x61\x95\x68\xf1\xba\x94\xba\xbd\xa3\x7c\x9f\xb5\xb7\x37\xc4\x7c\x7c\x8f\x7b\x89\x05\x0b\x48\x3c\xdb\xcc\x20\xee\x24\x44\x35\xe8\xca\x38\xe4\x5e\x62\x7a\x22\xef\x84\xbc\x0d\x16\x1c\xe6\x63\xf1\x60\xc7\xed\x08\x97\x5d\x39\xbf\x57\x9f\x1c\x1e\xf7\x61\x34\xf3\xd1\xc1\xe0\xbd\xed\xd9\xda\x24\x27\xa7\x33\x6e\x45\xc0\x42\x51\x4b\xa4\x8b\xcc\x7d\x35\x90\xdf\xfd\x17\x7d\xbe\x8d\x91\xce\x0e\x20\x4e\x0c\xd5\x9b\x83\x9f\xeb\xef\x07\xa6\xf7\x4b\x3d\xbe\x13\x7f\x6f\xcd\xdb\x76\xb1\xde\xc7\x8a\x78\xd3\xcd\x2d\x3a\x7d\x57\x0b\xa3\xd7\xd1\x15\x1c\xaf\x1e\x03\x12\x57\x66\x25\xb9\x0f\xe8\xda\xd3\x30\x57\x3a\x4f\xcf\x7d\x3d\x9d\xa7\xcf\x01\x00\x00\xff\xff\xfd\xe2\xfa\x51\x93\x0b\x00\x00") + +func capiCapaManagerClusterroleYamlBytes() ([]byte, error) { + return bindataRead( + _capiCapaManagerClusterroleYaml, + "capi/capa-manager-clusterrole.yaml", + ) +} + +func capiCapaManagerClusterroleYaml() (*asset, error) { + bytes, err := capiCapaManagerClusterroleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/capa-manager-clusterrole.yaml", size: 2963, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0xef, 0x4a, 0x71, 0xb7, 0x5d, 0xb, 0xf2, 0xfe, 0xd5, 0x6a, 0x40, 0xd1, 0xd7, 0x9a, 0x75, 0xd4, 0x91, 0xf2, 0xaf, 0x32, 0x5f, 0xe9, 0x8c, 0x6b, 0x9, 0x15, 0xde, 0x61, 0xfd, 0x5f, 0x4a}} + return a, nil +} + +var _capiCapaManagerClusterrolebindingYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8d\xb1\x4a\x04\x41\x0c\x86\xfb\x79\x8a\xbc\xc0\x8e\xd8\xc9\x74\x6a\x61\x67\x71\x82\x7d\x36\x1b\xcf\x78\xb3\xc9\x90\xc9\x5c\xe1\x71\xef\x2e\x0b\x77\x82\x88\x76\x09\x7c\xff\xf7\x61\x93\x57\xf6\x2e\xa6\x05\x7c\x46\xca\x38\xe2\xdd\x5c\x3e\x31\xc4\x34\x1f\xee\x7a\x16\xbb\x39\xde\xa6\x83\xe8\x52\xe0\xb1\x8e\x1e\xec\x3b\xab\xfc\x20\xba\x88\xee\xd3\xca\x81\x0b\x06\x96\x04\xa0\xb8\x72\x01\xc2\x86\xd3\x8a\x8a\x7b\xf6\xc9\xad\xf2\x7c\x41\xb7\x7b\xc7\x6f\x1b\x89\x4d\x9e\xdc\x46\xfb\xa7\x9a\x00\x7e\x45\xff\x6e\xa4\x3e\xe6\x0f\xa6\xe8\x9b\x7d\xba\x2c\x5f\xd8\x8f\x42\x7c\x4f\x64\x43\x23\x01\xfc\x98\x93\x69\xb8\xd5\xca\x7e\x35\x7d\x13\xbd\x21\x71\x81\xd3\x09\xf2\xf3\xf5\x85\xf3\x39\x7d\x05\x00\x00\xff\xff\x19\xd2\x37\xd4\x2f\x01\x00\x00") + +func capiCapaManagerClusterrolebindingYamlBytes() ([]byte, error) { + return bindataRead( + _capiCapaManagerClusterrolebindingYaml, + "capi/capa-manager-clusterrolebinding.yaml", + ) +} + +func capiCapaManagerClusterrolebindingYaml() (*asset, error) { + bytes, err := capiCapaManagerClusterrolebindingYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/capa-manager-clusterrolebinding.yaml", size: 303, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x15, 0xa9, 0x96, 0x70, 0xae, 0x9, 0x18, 0x78, 0x87, 0x84, 0xfb, 0x4, 0xac, 0x2d, 0x55, 0x64, 0x55, 0xf5, 0xab, 0x37, 0xf6, 0xbe, 0xa2, 0x5f, 0x7, 0xa7, 0x9c, 0x39, 0xb5, 0x22, 0xb3, 0x4b}} + return a, nil +} + +var _capiCapaManagerDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x54\xdd\x4e\xe3\x3c\x10\xbd\xcf\x53\xf8\x05\xd2\x7e\x48\xdc\x7c\x96\xb8\xa8\xa0\xcb\x22\xb1\x55\x44\xd1\xee\x25\x1a\x9c\xa1\xb1\x98\x78\xbc\xe3\x49\x50\x16\xf1\xee\x2b\xd3\x06\xa5\xed\xc2\xfe\xf8\x2a\x1e\xcf\x39\x67\xe6\x64\xec\xb2\x2c\x0b\x88\xfe\x2b\x4a\xf2\x1c\xac\x81\x18\xd3\xbc\x3f\x29\x1e\x7d\xa8\xad\xb9\xc0\x48\x3c\xb4\x18\xb4\x68\x51\xa1\x06\x05\x5b\x18\x13\xa0\x45\x6b\x1c\x44\x28\x1d\x07\x15\x26\x42\x29\x5b\x08\xb0\x41\x29\x8c\x21\xb8\x47\x4a\x39\xd3\x98\x5d\x42\x19\x09\xc2\x07\xa0\x14\xd1\x65\x40\x42\x42\xa7\x2c\x5b\x70\x0b\xea\x9a\xeb\x09\xdb\x1f\xf3\x19\x23\x18\xc9\x3b\x48\xd6\x9c\x14\xc6\x28\xb6\x91\x40\x71\xc7\x3b\x69\x26\x2f\xda\x93\xf8\x0b\x11\x63\xc6\xc2\x5f\xbf\x51\x7a\xef\x70\xe1\x1c\x77\x41\x57\xbf\x71\x69\x14\x02\x1f\x50\x26\xe2\xa5\x01\xd9\x4c\xf6\xdb\x58\x59\x66\xd7\x53\x04\x87\x67\xcf\xcf\x66\xb6\x1a\x77\xe6\xe5\xe5\x28\x15\x28\x31\xf1\x46\x39\x69\x8d\x22\x47\xe7\xfd\xd9\xe9\x24\xe6\x5b\xd8\xa0\x35\xdf\x3b\x18\x66\x9e\xe7\xcd\x10\x51\x52\xe3\x1f\x74\xee\xa8\x4b\x8a\x52\x42\xf4\x65\x14\xee\x7d\x9d\x37\x4f\xc9\xb6\x90\xe3\x87\x1c\x55\x47\x54\x31\x79\x37\x58\xb3\xa0\x27\x18\xd2\x24\x63\x3b\x34\xfb\xed\xe7\x15\x59\xf4\xa8\xdb\x37\x5f\x2a\x16\xb5\xe6\xff\xd3\xd3\xff\xf6\x32\x46\xba\x06\x81\xb4\xf9\x71\x70\x16\x85\x95\x1d\x93\x35\xb7\xe7\xd5\xe4\x4c\x10\x6a\x1f\x30\xa5\x4a\xf8\x1e\xf7\x35\x1b\xd5\x78\x89\x6a\x0f\xa9\x40\x1b\x6b\xe6\x19\x39\x1c\xc9\xbc\xd6\x76\x5c\x02\xf9\x1e\xff\x49\xe5\x9d\x6e\xde\x91\xc1\xd0\x1f\xda\xb6\x35\x65\xf1\x6d\x7d\xb7\xfe\xbc\xb8\x59\x5e\xdc\x9d\xdf\x2c\x2f\x96\xab\xdb\xab\xc5\xf5\xfa\xee\xd3\xd5\xf5\xf2\x80\xba\x07\xea\x30\x0b\x73\x8b\xf3\x19\x3c\xa5\xb9\x13\xac\x31\xa8\x07\x9a\xfe\xbb\x9e\xa9\x6b\xf1\x4b\x9e\xea\xa3\x5f\xb5\x7b\x0c\x7e\x89\xcb\xab\xcd\xa8\x6a\xd7\xe0\xa8\x53\x4c\x79\xf7\x66\xff\x23\xba\x84\x4e\x0e\xcd\xdb\xc6\xb6\x77\xed\x6d\x44\x33\x7c\x04\x2a\x4a\xeb\x03\xa8\xe7\x70\x29\xe0\xb0\x42\xf1\x5c\xaf\xd1\x71\xa8\xf3\xe3\x30\x0e\x96\x32\xa1\xbc\xa6\xed\xd5\x83\x0f\x0f\xe8\xd4\x9a\x15\xaf\x5d\x83\x75\x47\x38\x91\x7f\xc4\xc1\x9a\xc0\x35\x96\xc2\x84\xb3\xc7\xee\x1e\x25\xa0\x62\xca\xf7\x68\x77\x47\x7e\x06\x00\x00\xff\xff\xf3\x15\x82\xb3\x62\x05\x00\x00") + +func capiCapaManagerDeploymentYamlBytes() ([]byte, error) { + return bindataRead( + _capiCapaManagerDeploymentYaml, + "capi/capa-manager-deployment.yaml", + ) +} + +func capiCapaManagerDeploymentYaml() (*asset, error) { + bytes, err := capiCapaManagerDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/capa-manager-deployment.yaml", size: 1378, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x23, 0xd4, 0xb0, 0x50, 0x30, 0xe5, 0x5a, 0x57, 0xcd, 0x18, 0xba, 0x5c, 0x42, 0xce, 0x8b, 0x6, 0xcc, 0x79, 0xcb, 0xf9, 0x8e, 0xb1, 0x5e, 0xb8, 0xf2, 0x8a, 0x96, 0xd8, 0x90, 0xf0, 0x57}} + return a, nil +} + +var _capiCapaManagerServiceaccountYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\xb1\x0d\x03\x31\x08\x05\xd0\xde\x53\xb0\x80\x8b\xb4\x74\x99\x21\x52\xfa\x2f\x8c\x22\x14\x1b\x2c\x8e\xf3\xfc\xf7\xb0\xed\xab\x79\x59\x38\xd3\x79\xb5\xbf\xf9\x60\xfa\x68\x1e\x13\x7d\x8b\xc4\xed\xd5\x96\x16\x06\x0a\xdc\x88\x1c\x4b\x99\x04\x1b\x5d\xc2\x2b\x63\x4e\xcd\xbe\xe0\xf8\x69\x3e\x01\x00\x00\xff\xff\xfb\x85\xa6\xe2\x4d\x00\x00\x00") + +func capiCapaManagerServiceaccountYamlBytes() ([]byte, error) { + return bindataRead( + _capiCapaManagerServiceaccountYaml, + "capi/capa-manager-serviceaccount.yaml", + ) +} + +func capiCapaManagerServiceaccountYaml() (*asset, error) { + bytes, err := capiCapaManagerServiceaccountYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/capa-manager-serviceaccount.yaml", size: 77, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0x54, 0x7e, 0x1a, 0x44, 0x8f, 0xaf, 0xe, 0x93, 0x53, 0x41, 0x28, 0x8e, 0xb2, 0xf2, 0x46, 0x9a, 0x91, 0x50, 0xa4, 0x97, 0x76, 0x96, 0xee, 0x60, 0xea, 0x68, 0x5d, 0x19, 0x30, 0x15, 0xea}} + return a, nil +} + +var _capiManagerClusterroleYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x52\xb1\x8e\xdb\x30\x0c\xdd\xfd\x15\x42\x96\x00\x05\xec\xa0\x5b\xe1\xb5\x43\xf7\x0e\xdd\x19\x89\x8e\x85\xc8\xa4\x40\x52\x69\xda\xaf\x2f\xec\x38\x6d\x2f\xb1\x93\x3b\xdc\x4d\x96\xc9\xc7\xf7\xc8\x87\x07\x39\xfe\x40\xd1\xc8\xd4\x3a\xd9\x83\x6f\xa0\x58\xcf\x12\x7f\x83\x45\xa6\xe6\xf8\x45\x9b\xc8\xbb\xd3\xe7\xea\x18\x29\xb4\xee\x6b\x2a\x6a\x28\xdf\x39\x61\x35\xa0\x41\x00\x83\xb6\x72\x8e\x60\xc0\xd6\xf9\x4b\xb7\x86\x1c\x2b\x29\x09\xb5\xad\x6a\x07\x39\x7e\x13\x2e\x59\x47\xdc\xf4\x8b\x67\x43\x1a\x25\x75\xe6\xaf\x9c\x13\x54\x2e\xe2\x71\x46\xf9\xa2\xc6\xc3\xb5\x18\xb0\x8b\x14\xc7\x85\xb4\x72\xee\x84\xb2\x9f\x61\x07\xb4\xe9\x9b\xa2\x5e\x1e\x3f\xc1\x7c\x7f\x2f\xba\x67\x36\x35\x81\xdc\xcc\x2b\x36\xe7\xfa\xaf\x74\xed\x3c\x93\x09\xa7\x9c\x80\x70\x19\x11\xa9\x13\x50\x93\xe2\xad\xc8\x0a\x66\x00\xdf\x47\x42\x5d\xee\xe2\x39\x37\xaf\x61\x81\x10\x46\x63\x56\x39\x96\x0f\xb8\x2f\xde\x18\xba\xfd\xb4\x7d\x69\xdd\x58\xb8\xf3\xa9\xff\x95\x51\xb4\x8f\x9d\x35\x9c\x91\x2e\xaf\x25\xba\x9e\xd5\x30\xfc\xef\x9b\xae\xd5\x77\x6a\x60\x45\xe7\x03\x0c\x85\x20\x4d\x46\xcc\x4b\x3f\xe8\xfc\x1b\x7d\xb6\xf8\x66\xb3\x90\x21\xa6\x2e\x1e\x06\xc8\xcf\x42\x93\xa7\xd0\x3c\x88\xcf\x12\x3b\x9e\x90\xec\x86\xd9\x0b\x82\xe1\x07\x8a\x10\x07\x5c\xd7\x08\x98\xf0\xb9\x5c\xc9\xe1\x3a\xf0\x06\x65\x45\x2f\xf8\x9e\xfb\xfe\x04\x00\x00\xff\xff\x8a\x12\xad\x14\x59\x04\x00\x00") + +func capiManagerClusterroleYamlBytes() ([]byte, error) { + return bindataRead( + _capiManagerClusterroleYaml, + "capi/manager-clusterrole.yaml", + ) +} + +func capiManagerClusterroleYaml() (*asset, error) { + bytes, err := capiManagerClusterroleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/manager-clusterrole.yaml", size: 1113, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7d, 0xe4, 0xc3, 0x70, 0xab, 0xae, 0x6f, 0xee, 0xa9, 0x21, 0xd2, 0x46, 0x1d, 0xc4, 0x90, 0xf6, 0xdd, 0x12, 0xfe, 0xe3, 0x3f, 0x1b, 0x43, 0x3f, 0xc5, 0x25, 0xb1, 0xd0, 0xf6, 0x33, 0x81, 0xba}} + return a, nil +} + +var _capiManagerClusterrolebindingYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8d\xb1\xae\xc2\x30\x0c\x45\xf7\x7c\x85\x7f\xa0\x79\x7a\x1b\xca\x06\x0c\x6c\x0c\x45\x62\x77\x53\x03\xa6\x6d\x1c\x25\x4e\x07\xaa\xfe\x3b\x42\x85\x89\x8a\xd1\xbe\xf7\xdc\x83\x91\xcf\x94\x32\x4b\x70\x90\x1a\xf4\x16\x8b\xde\x24\xf1\x03\x95\x25\xd8\x6e\x93\x2d\xcb\xdf\xf8\x6f\x3a\x0e\xad\x83\x7d\x5f\xb2\x52\xaa\xa5\xa7\x1d\x87\x96\xc3\xd5\x0c\xa4\xd8\xa2\xa2\x33\x00\x01\x07\x72\xe0\x97\x52\x85\x91\x4d\x92\x9e\x6a\xba\xbc\x42\x8c\x7c\x48\x52\xe2\x0f\x91\x01\xf8\xf2\xac\xce\xe6\xd2\xdc\xc9\x6b\x76\xa6\x7a\x13\x27\x4a\x23\x7b\xda\x7a\x2f\x25\xe8\x2a\xb4\xfc\x72\x44\x4f\x0e\xa6\x09\xec\xf1\x73\xc2\x3c\x9b\x67\x00\x00\x00\xff\xff\x1a\x7b\x6c\x93\x0a\x01\x00\x00") + +func capiManagerClusterrolebindingYamlBytes() ([]byte, error) { + return bindataRead( + _capiManagerClusterrolebindingYaml, + "capi/manager-clusterrolebinding.yaml", + ) +} + +func capiManagerClusterrolebindingYaml() (*asset, error) { + bytes, err := capiManagerClusterrolebindingYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/manager-clusterrolebinding.yaml", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb8, 0x27, 0x2, 0x83, 0x2c, 0x93, 0x57, 0x2, 0x8b, 0xb2, 0x1, 0x17, 0x59, 0xf5, 0x89, 0x5a, 0x53, 0x9d, 0x7b, 0xd6, 0xb2, 0xf6, 0x98, 0x5c, 0xd1, 0x5d, 0xff, 0x3c, 0xa4, 0x59, 0x40, 0x7d}} + return a, nil +} + +var _capiManagerDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xbb\x6e\xf3\x30\x0c\x85\x77\x3d\x05\x5f\xc0\x31\x02\xfc\x93\x80\x0c\x01\xfe\xb1\x08\x32\x75\x67\x69\xd6\x11\x4a\x5d\x2a\xd2\x29\x8c\x20\xef\x5e\xb8\xcd\xc5\x2e\xac\x49\xe2\x39\xe7\x3b\x14\x96\xf0\xca\x55\x43\x4e\x1e\xb0\x14\x6d\xcf\x5b\xf7\x11\x52\xe7\xe1\x3f\x17\xc9\x63\xe4\x64\x2e\xb2\x61\x87\x86\xde\x01\x24\x8c\xec\x81\x64\x50\xe3\xda\x60\x09\x4e\x0b\xd3\xa4\x54\x2e\x12\x08\xd5\xc3\xd6\x01\x28\x0b\x93\xe5\x3a\x29\x00\x11\x8d\x4e\x2f\xf8\xc6\xa2\xbf\x83\x35\x10\x80\x71\x2c\x82\xc6\xb7\xd0\xac\x76\x3a\xb2\xc8\xaf\x13\x00\xee\xeb\xfc\xdc\xb9\x9e\x03\xf1\x9e\x28\x0f\xc9\x0e\xab\x7e\x00\xca\xc9\x30\x24\xae\x0f\x76\x73\x63\x47\x4c\xd8\x73\x7d\x34\x86\x88\x3d\x7b\xf8\x1c\x70\xdc\x84\xdc\x9e\xc6\xc2\x55\x4f\xe1\xdd\xda\x19\xd5\x3f\xc7\xcb\xe0\x71\x10\x39\x66\x09\x34\x7a\xd8\xcb\x17\x8e\xfa\xd0\x29\xc7\x88\xa9\x7b\xfe\xad\x81\xf6\x6f\x39\xd6\x5e\xe7\x86\xa6\x99\x96\xd4\x82\xc4\xbb\xcb\x05\x36\x87\xfb\x0b\xae\xd7\x85\x0d\x45\xb3\xe4\xde\xb2\x5a\xc7\xb5\x2e\xb4\xf3\xee\x9f\xfb\x0e\x00\x00\xff\xff\x02\x65\x5c\xe9\x04\x02\x00\x00") + +func capiManagerDeploymentYamlBytes() ([]byte, error) { + return bindataRead( + _capiManagerDeploymentYaml, + "capi/manager-deployment.yaml", + ) +} + +func capiManagerDeploymentYaml() (*asset, error) { + bytes, err := capiManagerDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/manager-deployment.yaml", size: 516, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0xe2, 0xdb, 0xed, 0xe7, 0x68, 0x5f, 0xa5, 0x61, 0x62, 0x6b, 0x41, 0x89, 0xb1, 0xaa, 0xf0, 0x2, 0x28, 0xc2, 0x45, 0x6d, 0xba, 0xef, 0x3c, 0xb8, 0xf3, 0x36, 0x5e, 0x51, 0xbf, 0xd7, 0x89}} + return a, nil +} + +var _capiManagerServiceaccountYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\x31\x0e\x80\x20\x0c\x05\xd0\xbd\xa7\xe8\x05\x1c\x5c\xbb\x79\x06\x13\xf7\xa6\xfc\xa1\x51\x0a\x81\xc2\xf9\x7d\xda\xfd\xc1\x98\xde\x42\x78\x9f\xf4\x7a\x14\xe1\x1b\x63\xbb\xe1\x32\x6b\x2b\x92\x2a\x52\x8b\xa6\x0a\x31\x87\x56\x08\xdb\xb7\x66\x62\x1c\xda\x9d\xfe\x00\x00\x00\xff\xff\x14\xfb\x48\x04\x42\x00\x00\x00") + +func capiManagerServiceaccountYamlBytes() ([]byte, error) { + return bindataRead( + _capiManagerServiceaccountYaml, + "capi/manager-serviceaccount.yaml", + ) +} + +func capiManagerServiceaccountYaml() (*asset, error) { + bytes, err := capiManagerServiceaccountYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "capi/manager-serviceaccount.yaml", size: 66, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0xd3, 0x3c, 0x7d, 0xa3, 0x26, 0x1e, 0x82, 0x92, 0x74, 0x79, 0x40, 0xca, 0x91, 0x9e, 0x73, 0x8d, 0x2a, 0xe9, 0x1a, 0xf7, 0xcb, 0xa3, 0x30, 0x3c, 0xdd, 0xaf, 0x7a, 0xca, 0xbb, 0x42, 0x55}} + return a, nil +} + +var _controlPlaneOperatorCpOperatorDeploymentYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x92\x4f\x6b\xe3\x30\x10\xc5\xef\xfe\x14\x83\xd9\xc3\x2e\xac\x63\x72\xd5\xcd\x64\xb3\xb0\xb0\x49\x4d\x0b\x85\x52\x4a\x99\xc8\x93\x44\x74\xf4\x07\x49\x76\x09\x21\xdf\xbd\x28\x7f\xd4\x04\x5a\xac\x93\xfd\xde\x6f\xde\x8c\xc4\xa0\x53\x8f\xe4\x83\xb2\x46\x00\x3a\x17\xea\x61\x5a\xbc\x29\xd3\x09\xf8\x43\x8e\xed\x4e\x93\x89\x85\xa6\x88\x1d\x46\x14\x05\x80\x41\x4d\x02\xa4\x35\xd1\x5b\xae\x1c\xa3\xa1\xca\x3a\xf2\x18\xad\x2f\x82\x23\x99\x20\x4f\x8e\x95\xc4\x20\x60\x5a\x00\x04\x62\x92\xd1\xfa\xe4\x00\x68\x8c\x72\xfb\x1f\x57\xc4\xe1\x24\x8c\x64\x02\x44\xd2\x8e\x31\xd2\xb9\xfe\x6a\x98\x74\xf8\x26\x6a\x34\x0c\xe0\x32\xe4\xf1\x9b\xfc\xa0\x24\x35\x52\xda\xde\xc4\xe5\x58\x29\x1c\x4d\x54\x86\x7c\xee\x58\x8d\x77\x4c\x47\x69\xdc\x90\x80\xfd\x1e\x26\xb3\x13\xd9\x26\xf0\xee\xcc\xfd\x4b\x36\x1c\x0e\xb7\x7c\xdb\x33\xb7\x96\x95\xdc\x09\x68\xf8\x1d\x77\x21\xfb\x64\x86\xcf\x3b\x5f\x66\x58\x3c\xbd\x2e\x9b\xc5\xfc\xa1\x6d\x66\xf3\x6c\x02\x0c\xc8\x3d\xfd\xf5\x56\x8b\x2b\x11\x60\xad\x88\xbb\x7b\x5a\xdf\xaa\x67\xbd\xc5\xb8\x15\xf9\xb1\x27\x29\x3f\x38\x94\x94\x59\x69\xb5\xc6\xb4\x28\xcf\x65\xdd\x07\x5f\xaf\x94\xa9\xbf\x7e\x83\xf2\x25\x17\xa1\xdf\x84\x54\xe1\x7b\x53\xfe\x86\xb2\xaa\x72\x6e\xfa\xfd\xf1\xf3\xfa\x02\xbf\x4e\x44\x97\xf7\xf0\x08\x27\xf1\xdb\x36\x1f\x01\x00\x00\xff\xff\x58\x9a\x8c\x15\xce\x02\x00\x00") + +func controlPlaneOperatorCpOperatorDeploymentYamlBytes() ([]byte, error) { + return bindataRead( + _controlPlaneOperatorCpOperatorDeploymentYaml, + "control-plane-operator/cp-operator-deployment.yaml", + ) +} + +func controlPlaneOperatorCpOperatorDeploymentYaml() (*asset, error) { + bytes, err := controlPlaneOperatorCpOperatorDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "control-plane-operator/cp-operator-deployment.yaml", size: 718, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5d, 0x5a, 0x26, 0xaa, 0xd9, 0x62, 0x74, 0x8c, 0xf5, 0x26, 0xa3, 0xa8, 0xf3, 0x76, 0x12, 0x17, 0x8b, 0x83, 0x24, 0x58, 0xec, 0xb8, 0x40, 0x49, 0xd4, 0xfa, 0x9a, 0x33, 0x85, 0xca, 0xb8, 0xc0}} + return a, nil +} + +var _controlPlaneOperatorCpOperatorRoleYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x54\xb1\x8e\xdc\x40\x08\xed\xfd\x15\xa3\x6b\x4e\x8a\xe4\x39\xa5\x8b\xdc\xa6\x48\x9f\x22\x3d\xcb\xb0\x67\x74\xf6\x30\x02\x66\xb3\x9b\xaf\x8f\xbc\xb6\x93\x28\xde\x55\x9c\xd5\x55\x06\x0c\xcf\x8f\x07\x18\x0a\x7f\x23\x35\x96\xdc\x05\x3d\x00\x46\xa8\xde\x8b\xf2\x0f\x70\x96\x1c\xdf\x3e\x59\x64\x79\x39\x7d\x6c\xde\x38\xa7\x2e\x7c\x1e\xaa\x39\xe9\x57\x19\xa8\x19\xc9\x21\x81\x43\xd7\x84\x90\x61\xa4\x2e\xa0\x64\x57\x19\xda\x32\x40\xa6\x56\x0a\x29\xb8\x68\xa3\x75\x20\xeb\x9a\x36\x40\xe1\x2f\x2a\xb5\xd8\x54\xd2\x86\xfe\x52\x48\xad\xe7\xa3\x47\x29\x94\x67\x8b\xa5\x09\x41\xc9\xa4\x2a\xd2\x92\xf8\xfc\xe1\xb9\x09\xe1\x44\x7a\xf8\x23\xb0\x81\x43\xc9\x47\x7e\xfd\x5f\xa8\x57\xf2\xeb\x73\x60\x9b\x8d\xef\xe0\xd8\x6f\xd1\xa1\x30\x9d\x9d\xf2\x24\x95\x2d\xba\x6c\xe1\xb1\x9a\xcb\xb8\x06\x13\x1d\x39\xf3\x24\xa4\xed\xe0\x7f\x10\x71\x73\x85\x12\x71\x56\x39\x9e\xdb\x5f\xdf\x69\x57\x71\xaf\xda\xde\xce\xe0\x7c\x54\x30\xd7\x8a\x5e\xf5\x4e\xce\x08\xd8\x73\x26\xbb\xfd\x96\xce\x25\xee\x41\x81\x94\x26\x15\xee\x62\xdc\x6e\x60\x1b\x7c\x68\xce\xeb\x5e\xbd\xcb\xd2\xa8\x54\xa7\x77\x41\x32\xc2\xaa\xec\x97\x7f\x80\xad\x69\xd3\x38\xe9\xec\x28\x79\x9a\x39\x67\xdf\xb3\x22\x77\x2f\xf4\x51\xd2\x4f\x4f\xdb\x4a\x3a\xd1\xcc\x66\x3d\xa9\x11\xca\xec\x16\x49\xbf\x8d\x97\x41\x5e\xd7\x8e\x94\x96\x82\x2c\x89\x16\x0b\x46\xb2\x02\xb8\xb8\x46\x7a\x62\x24\x40\x94\xba\xa2\x2f\xb1\x3d\x8d\x43\xb9\x52\xf8\x8b\x69\xa2\x32\xc8\x65\xa4\x7d\xe2\x91\x63\x8a\xd3\x0f\xeb\x00\x46\x11\x45\x49\x2c\xa2\x8c\x8f\x6a\xb7\x9c\xd2\x23\xcb\xf3\x33\x00\x00\xff\xff\x75\x2c\xc5\xbb\x76\x05\x00\x00") + +func controlPlaneOperatorCpOperatorRoleYamlBytes() ([]byte, error) { + return bindataRead( + _controlPlaneOperatorCpOperatorRoleYaml, + "control-plane-operator/cp-operator-role.yaml", + ) +} + +func controlPlaneOperatorCpOperatorRoleYaml() (*asset, error) { + bytes, err := controlPlaneOperatorCpOperatorRoleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "control-plane-operator/cp-operator-role.yaml", size: 1398, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6e, 0xb2, 0x6e, 0x24, 0xb, 0x87, 0xe8, 0xa4, 0xa5, 0x5, 0x8b, 0xd1, 0x9f, 0x54, 0x91, 0x22, 0x3f, 0xe5, 0x5d, 0x62, 0x34, 0x0, 0x67, 0x15, 0xd2, 0xcd, 0xa8, 0xa0, 0x55, 0xee, 0x19, 0x81}} + return a, nil +} + +var _controlPlaneOperatorCpOperatorRolebindingYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\xcd\x31\x4e\xc5\x30\x0c\xc6\xf1\x3d\xa7\xf0\x05\x1a\xc4\x86\xb2\x01\x03\x1b\x43\x91\xd8\xdd\xd4\x80\x69\x6a\x47\x8e\xd3\x81\xaa\x77\x47\x08\x98\x9e\xf4\x3a\x5a\xfe\xfe\xfa\x61\xe5\x57\xb2\xc6\x2a\x09\x6c\xc2\x1c\xb1\xfb\x87\x1a\x7f\xa1\xb3\x4a\x5c\xee\x5a\x64\xbd\xd9\x6e\xc3\xc2\x32\x27\x78\x2c\xbd\x39\xd9\xa8\x85\x1e\x58\x66\x96\xf7\xb0\x92\xe3\x8c\x8e\x29\x00\x08\xae\x94\x20\xab\xb8\x69\x19\x6a\x41\xa1\x41\x2b\x19\xba\x5a\x30\x2d\x34\xd2\xdb\xcf\x0e\x2b\x3f\x99\xf6\x7a\xc5\x0c\x00\x17\xe4\x99\xd0\xfa\xf4\x49\xd9\x5b\x0a\xc3\x5f\xfc\x42\xb6\x71\xa6\xfb\x9c\xb5\x8b\x9f\xf5\xbf\xef\x56\x31\x53\x82\x7d\x87\xf8\xfc\x7f\xc2\x71\x84\xef\x00\x00\x00\xff\xff\x43\xd6\x24\x66\x2b\x01\x00\x00") + +func controlPlaneOperatorCpOperatorRolebindingYamlBytes() ([]byte, error) { + return bindataRead( + _controlPlaneOperatorCpOperatorRolebindingYaml, + "control-plane-operator/cp-operator-rolebinding.yaml", + ) +} + +func controlPlaneOperatorCpOperatorRolebindingYaml() (*asset, error) { + bytes, err := controlPlaneOperatorCpOperatorRolebindingYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "control-plane-operator/cp-operator-rolebinding.yaml", size: 299, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x27, 0xb4, 0xff, 0xef, 0x5c, 0xc1, 0x4, 0xf2, 0xbb, 0xdf, 0xa5, 0xba, 0xa7, 0x0, 0x6, 0xe, 0xb9, 0xe, 0x33, 0xcd, 0xf6, 0x46, 0x24, 0xc3, 0xd0, 0x7d, 0x32, 0x4, 0x58, 0xa3, 0x53}} + return a, nil +} + +var _controlPlaneOperatorCpOperatorServiceaccountYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\x31\x0e\x80\x30\x08\x00\xc0\x9d\x57\xf0\x81\x0e\xae\x6c\xbe\xc1\xc4\x9d\x50\x06\x62\x0b\x0d\x62\xdf\xef\xf1\xb2\x5b\xf3\xb5\x70\xc2\x7d\xc0\x63\xde\x09\x2f\xcd\x6d\xa2\xa7\x48\x7c\x5e\x30\xb5\xb8\x73\x31\x01\xa2\xf3\x54\x42\x09\xaf\x8c\xd1\xd6\x60\xd7\x16\x4b\x93\x2b\x12\xfe\x00\x00\x00\xff\xff\x39\x3b\x03\x7d\x4d\x00\x00\x00") + +func controlPlaneOperatorCpOperatorServiceaccountYamlBytes() ([]byte, error) { + return bindataRead( + _controlPlaneOperatorCpOperatorServiceaccountYaml, + "control-plane-operator/cp-operator-serviceaccount.yaml", + ) +} + +func controlPlaneOperatorCpOperatorServiceaccountYaml() (*asset, error) { + bytes, err := controlPlaneOperatorCpOperatorServiceaccountYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "control-plane-operator/cp-operator-serviceaccount.yaml", size: 77, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa0, 0x34, 0x79, 0xd4, 0x6e, 0x15, 0x54, 0xce, 0xe5, 0xf, 0x9c, 0xd2, 0x0, 0x86, 0x9a, 0x2e, 0xb7, 0x72, 0x1b, 0x93, 0xc1, 0x5d, 0xa, 0xba, 0xf4, 0xe0, 0x2c, 0x47, 0x40, 0xb1, 0x7, 0xd1}} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "capi/capa-manager-clusterrole.yaml": capiCapaManagerClusterroleYaml, + "capi/capa-manager-clusterrolebinding.yaml": capiCapaManagerClusterrolebindingYaml, + "capi/capa-manager-deployment.yaml": capiCapaManagerDeploymentYaml, + "capi/capa-manager-serviceaccount.yaml": capiCapaManagerServiceaccountYaml, + "capi/manager-clusterrole.yaml": capiManagerClusterroleYaml, + "capi/manager-clusterrolebinding.yaml": capiManagerClusterrolebindingYaml, + "capi/manager-deployment.yaml": capiManagerDeploymentYaml, + "capi/manager-serviceaccount.yaml": capiManagerServiceaccountYaml, + "control-plane-operator/cp-operator-deployment.yaml": controlPlaneOperatorCpOperatorDeploymentYaml, + "control-plane-operator/cp-operator-role.yaml": controlPlaneOperatorCpOperatorRoleYaml, + "control-plane-operator/cp-operator-rolebinding.yaml": controlPlaneOperatorCpOperatorRolebindingYaml, + "control-plane-operator/cp-operator-serviceaccount.yaml": controlPlaneOperatorCpOperatorServiceaccountYaml, +} + +// AssetDebug is true if the assets were built with the debug flag enabled. +const AssetDebug = false + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "capi": {nil, map[string]*bintree{ + "capa-manager-clusterrole.yaml": {capiCapaManagerClusterroleYaml, map[string]*bintree{}}, + "capa-manager-clusterrolebinding.yaml": {capiCapaManagerClusterrolebindingYaml, map[string]*bintree{}}, + "capa-manager-deployment.yaml": {capiCapaManagerDeploymentYaml, map[string]*bintree{}}, + "capa-manager-serviceaccount.yaml": {capiCapaManagerServiceaccountYaml, map[string]*bintree{}}, + "manager-clusterrole.yaml": {capiManagerClusterroleYaml, map[string]*bintree{}}, + "manager-clusterrolebinding.yaml": {capiManagerClusterrolebindingYaml, map[string]*bintree{}}, + "manager-deployment.yaml": {capiManagerDeploymentYaml, map[string]*bintree{}}, + "manager-serviceaccount.yaml": {capiManagerServiceaccountYaml, map[string]*bintree{}}, + }}, + "control-plane-operator": {nil, map[string]*bintree{ + "cp-operator-deployment.yaml": {controlPlaneOperatorCpOperatorDeploymentYaml, map[string]*bintree{}}, + "cp-operator-role.yaml": {controlPlaneOperatorCpOperatorRoleYaml, map[string]*bintree{}}, + "cp-operator-rolebinding.yaml": {controlPlaneOperatorCpOperatorRolebindingYaml, map[string]*bintree{}}, + "cp-operator-serviceaccount.yaml": {controlPlaneOperatorCpOperatorServiceaccountYaml, map[string]*bintree{}}, + }}, +}} + +// RestoreAsset restores an asset under the given directory. +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) +} + +// RestoreAssets restores an asset under the given directory recursively. +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) +} diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrole.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrole.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrole.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrole.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrolebinding.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-clusterrolebinding.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-clusterrolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-deployment.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-deployment.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-serviceaccount.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/capa-manager-serviceaccount.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/capa-manager-serviceaccount.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrole.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrole.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrole.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrole.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrolebinding.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrolebinding.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/manager-clusterrolebinding.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/manager-clusterrolebinding.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/manager-deployment.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/manager-deployment.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/manager-deployment.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/manager-deployment.yaml diff --git a/hypershift-operator/assets/controlplane/hypershift/capi/manager-serviceaccount.yaml b/hypershift-operator/controllers/hostedcluster/assets/capi/manager-serviceaccount.yaml similarity index 100% rename from hypershift-operator/assets/controlplane/hypershift/capi/manager-serviceaccount.yaml rename to hypershift-operator/controllers/hostedcluster/assets/capi/manager-serviceaccount.yaml diff --git a/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-deployment.yaml b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-deployment.yaml new file mode 100644 index 000000000000..3d6471e58c16 --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-deployment.yaml @@ -0,0 +1,26 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: control-plane-operator +spec: + replicas: 1 + selector: + matchLabels: + name: control-plane-operator + template: + metadata: + labels: + name: control-plane-operator + spec: + serviceAccountName: control-plane-operator + containers: + - name: control-plane-operator + image: {{ .ControlPlaneOperatorImage }} + imagePullPolicy: Always + env: + - name: MY_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + command: ["/usr/bin/control-plane-operator"] + args: ["run", "--namespace", "$(MY_NAMESPACE)", "--deployment-name", "control-plane-operator"] diff --git a/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-role.yaml b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-role.yaml new file mode 100644 index 000000000000..02dce015c01d --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-role.yaml @@ -0,0 +1,94 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: control-plane-operator +rules: +- apiGroups: + - hypershift.openshift.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - config.openshift.io + resources: + - '*' + verbs: + - get + - list + - watch +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - '*' +- apiGroups: + - bootstrap.cluster.x-k8s.io + - controlplane.cluster.x-k8s.io + - infrastructure.cluster.x-k8s.io + - machines.cluster.x-k8s.io + - exp.infrastructure.cluster.x-k8s.io + - addons.cluster.x-k8s.io + - exp.cluster.x-k8s.io + - cluster.x-k8s.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - operator.openshift.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - route.openshift.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - security.openshift.io + resources: + - securitycontextconstraints + verbs: + - '*' +- apiGroups: + - rbac.authorization.k8s.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - "" + resources: + - events + - configmaps + - pods + - pods/log + - secrets + - nodes + - namespaces + - serviceaccounts + - services + verbs: + - '*' +- apiGroups: + - apps + resources: + - deployments + verbs: + - '*' +- apiGroups: + - etcd.database.coreos.com + resources: + - '*' + verbs: + - '*' +- apiGroups: + - machine.openshift.io + resources: + - '*' + verbs: + - '*' diff --git a/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-rolebinding.yaml b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-rolebinding.yaml new file mode 100644 index 000000000000..7f0a0e5ee9a9 --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-rolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: control-plane-operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: control-plane-operator +subjects: +- kind: ServiceAccount + name: control-plane-operator + namespace: {{ .Namespace }} diff --git a/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-serviceaccount.yaml b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-serviceaccount.yaml new file mode 100644 index 000000000000..b3ee42e12e5a --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/assets/control-plane-operator/cp-operator-serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: control-plane-operator diff --git a/hypershift-operator/controllers/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go similarity index 81% rename from hypershift-operator/controllers/hostedcluster_controller.go rename to hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index 7d8ee54abf48..d5ba5e4bcb21 100644 --- a/hypershift-operator/controllers/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controllers +package hostedcluster import ( "context" @@ -27,10 +27,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/util/retry" "k8s.io/client-go/util/workqueue" - hyperv1 "openshift.io/hypershift/api/v1alpha1" - "openshift.io/hypershift/hypershift-operator/releaseinfo" - hypershiftcp "openshift.io/hypershift/hypershift-operator/render/controlplane/hypershift" capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" @@ -40,27 +38,38 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + hyperv1 "openshift.io/hypershift/api/v1alpha1" ) const ( - finalizer = "hypershift.openshift.io/finalizer" - pullSecretName = "pull-secret" - sshKeySecretName = "ssh-key" - providerCredsSecretName = "provider-creds" - clusterNameIndexFieldName = "clusterName" + finalizer = "hypershift.openshift.io/finalizer" + pullSecretName = "pull-secret" + sshKeySecretName = "ssh-key" + providerCredsSecretName = "provider-creds" ) // HostedClusterReconciler reconciles a HostedCluster object type HostedClusterReconciler struct { client.Client - Log logr.Logger - ReleaseProvider releaseinfo.Provider - Infra *configv1.Infrastructure + + Log logr.Logger + OperatorImage string } // +kubebuilder:rbac:groups=hypershift.openshift.io,resources=hostedclusters,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=hypershift.openshift.io,resources=hostedclusters/status,verbs=get;update;patch +func (r *HostedClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&hyperv1.HostedCluster{}). + WithEventFilter(predicate.GenerationChangedPredicate{}). + WithOptions(controller.Options{ + RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second), + }). + Complete(r) +} + func (r *HostedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Log = ctrl.LoggerFrom(ctx) r.Log.Info("Reconciling") @@ -105,6 +114,11 @@ func (r *HostedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, nil } + var infra configv1.Infrastructure + if err := r.Get(context.Background(), client.ObjectKey{Name: "cluster"}, &infra); err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get cluster infra: %w", err) + } + targetNamespace := hcluster.GetName() r.Log.Info("Creating the target namespace", "namespace", targetNamespace) ns := &corev1.Namespace{ @@ -163,11 +177,12 @@ func (r *HostedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, fmt.Errorf("failed to create target ssh secret : %v", err) } - // run CAPI controllers - params := hypershiftcp.NewClusterParams() - params.Namespace = targetNamespace - releaseImage, err := r.ReleaseProvider.Lookup(ctx, hcluster.Spec.Release.Image) - manifests, err := hypershiftcp.RenderCAPIManifests(params, releaseImage, nil, nil) + // Install operators + params := &ClusterParams{ + Namespace: targetNamespace, + ControlPlaneOperatorImage: r.OperatorImage, + } + manifests, err := renderControlPlaneManifests(params) if err != nil { return ctrl.Result{}, fmt.Errorf("failed to render hypershift manifests for cluster: %w", err) } @@ -228,7 +243,7 @@ func (r *HostedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques }, Spec: hyperv1.ExternalInfraClusterSpec{ ComputeReplicas: hcluster.Spec.InitialComputeReplicas, - Region: r.Infra.Status.PlatformStatus.AWS.Region, + Region: infra.Status.PlatformStatus.AWS.Region, }, } @@ -287,22 +302,28 @@ func (r *HostedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, nil } -func (r *HostedClusterReconciler) listNodePools(key, value string) ([]hyperv1.NodePool, error) { +func (r *HostedClusterReconciler) listNodePools(clusterNamespace, clusterName string) ([]hyperv1.NodePool, error) { nodePoolList := &hyperv1.NodePoolList{} if err := r.Client.List( context.TODO(), nodePoolList, - client.MatchingFields{key: value}, ); err != nil { return nil, fmt.Errorf("failed getting nodePool list: %v", err) } - return nodePoolList.Items, nil + // TODO: do a label association or something + filtered := []hyperv1.NodePool{} + for i, nodePool := range nodePoolList.Items { + if nodePool.Namespace == clusterNamespace && nodePool.Name == clusterName { + filtered = append(filtered, nodePoolList.Items[i]) + } + } + return filtered, nil } func (r *HostedClusterReconciler) delete(ctx context.Context, req ctrl.Request) error { targetNamespace := req.Name - nodePools, err := r.listNodePools(clusterNameIndexFieldName, req.Name) + nodePools, err := r.listNodePools(req.Namespace, req.Name) if err != nil { return fmt.Errorf("failed to get nodePools by cluster name for cluster %q: %w", req.Name, err) } @@ -335,32 +356,6 @@ func (r *HostedClusterReconciler) delete(ctx context.Context, req ctrl.Request) return nil } -func (r *HostedClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { - var infra configv1.Infrastructure - if err := mgr.GetAPIReader().Get(context.Background(), client.ObjectKey{Name: "cluster"}, &infra); err != nil { - return fmt.Errorf("failed to get cluster infra: %w", err) - } - r.Infra = &infra - - // index nodePool by clusterName - mgr.GetCache().IndexField(context.Background(), &hyperv1.NodePool{}, clusterNameIndexFieldName, - func(object client.Object) []string { - if nodePool, ok := object.(*hyperv1.NodePool); ok { - return []string{nodePool.Spec.ClusterName} - } - return nil - }, - ) - - return ctrl.NewControllerManagedBy(mgr). - For(&hyperv1.HostedCluster{}). - WithEventFilter(predicate.GenerationChangedPredicate{}). - WithOptions(controller.Options{ - RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second), - }). - Complete(r) -} - func waitForDeletion(ctx context.Context, log logr.Logger, c client.Client, obj client.Object) error { log.WithValues("name", obj.GetName(), "namespace", obj.GetNamespace(), "kind", obj.GetObjectKind()) @@ -384,3 +379,45 @@ func waitForDeletion(ctx context.Context, log logr.Logger, c client.Client, obj } return nil } + +func createPullSecret(c client.Client, namespace string, data []byte) (*corev1.Secret, error) { + secret := &corev1.Secret{} + secret.Namespace = namespace + secret.Name = pullSecretName + secret.Data = map[string][]byte{".dockerconfigjson": []byte(data)} + secret.Type = corev1.SecretTypeDockerConfigJson + if err := c.Create(context.TODO(), secret); err != nil { + if !apierrors.IsAlreadyExists(err) { + return nil, fmt.Errorf("failed to create pull secret: %w", err) + } + } + return secret, retry.RetryOnConflict(retry.DefaultRetry, func() error { + sa := &corev1.ServiceAccount{} + if err := c.Get(context.TODO(), client.ObjectKey{Namespace: namespace, Name: "default"}, sa); err != nil { + return err + } + sa.ImagePullSecrets = append(sa.ImagePullSecrets, corev1.LocalObjectReference{Name: "pull-secret"}) + if err := c.Update(context.TODO(), sa); err != nil { + return err + } + return nil + }) +} + +func generateProviderCredsSecret(data []byte, namespace string) (*corev1.Secret, error) { + secret := &corev1.Secret{} + secret.Name = providerCredsSecretName + secret.Namespace = namespace + secret.Data = map[string][]byte{"credentials": data} + secret.Type = corev1.SecretTypeOpaque + return secret, nil +} + +func generateSSHSecret(data []byte, namespace string) (*corev1.Secret, error) { + secret := &corev1.Secret{} + secret.Name = sshKeySecretName + secret.Namespace = namespace + secret.Data = map[string][]byte{"id_rsa.pub": data} + secret.Type = corev1.SecretTypeOpaque + return secret, nil +} diff --git a/hypershift-operator/controllers/hostedcluster/manifests.go b/hypershift-operator/controllers/hostedcluster/manifests.go new file mode 100644 index 000000000000..33211f202e52 --- /dev/null +++ b/hypershift-operator/controllers/hostedcluster/manifests.go @@ -0,0 +1,161 @@ +package hostedcluster + +import ( + "bytes" + "context" + "fmt" + "path" + "text/template" + + "github.com/go-logr/logr" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/yaml" + "sigs.k8s.io/controller-runtime/pkg/client" + + "openshift.io/hypershift/hypershift-operator/controllers/hostedcluster/assets" +) + +type ClusterParams struct { + Namespace string `json:"namespace"` + ControlPlaneOperatorImage string `json:"controlPlaneOperatorImage"` +} + +var ( + excludeManifests = sets.NewString( + "openshift-apiserver-service.yaml", + "v4-0-config-system-branding.yaml", + "oauth-server-service.yaml", + "kube-apiserver-service.yaml", + ) +) + +// renderControlPlaneManifests renders manifests for a hosted cluster +func renderControlPlaneManifests(params *ClusterParams) (map[string][]byte, error) { + ctx := &clusterManifestContext{ + renderContext: newRenderContext(params), + userManifests: make(map[string]string), + } + ctx.capi() + ctx.controlPlaneOperator() + return ctx.renderManifests() +} + +type clusterManifestContext struct { + *renderContext + userManifestFiles []string + userManifests map[string]string +} + +func (c *clusterManifestContext) controlPlaneOperator() { + c.addManifestFiles( + "control-plane-operator/cp-operator-serviceaccount.yaml", + "control-plane-operator/cp-operator-role.yaml", + "control-plane-operator/cp-operator-rolebinding.yaml", + "control-plane-operator/cp-operator-deployment.yaml", + ) +} + +func (c *clusterManifestContext) capi() { + c.addManifestFiles( + "capi/capa-manager-serviceaccount.yaml", + "capi/capa-manager-clusterrole.yaml", + "capi/capa-manager-clusterrolebinding.yaml", + "capi/capa-manager-deployment.yaml", + "capi/manager-serviceaccount.yaml", + "capi/manager-clusterrole.yaml", + "capi/manager-clusterrolebinding.yaml", + "capi/manager-deployment.yaml", + ) +} + +func (c *clusterManifestContext) addUserManifestFiles(name ...string) { + c.userManifestFiles = append(c.userManifestFiles, name...) +} + +func (c *clusterManifestContext) addUserManifest(name, content string) { + c.userManifests[name] = content +} + +type renderContext struct { + params interface{} + funcs template.FuncMap + manifestFiles []string + manifests map[string][]byte +} + +func newRenderContext(params interface{}) *renderContext { + renderContext := &renderContext{ + params: params, + manifests: make(map[string][]byte), + } + return renderContext +} + +func (c *renderContext) setFuncs(f template.FuncMap) { + c.funcs = f +} + +func (c *renderContext) renderManifests() (map[string][]byte, error) { + result := make(map[string][]byte, len(c.manifestFiles)+len(c.manifests)) + for name, b := range c.manifests { + result[name] = b + } + for _, f := range c.manifestFiles { + content, err := c.substituteParams(c.params, f) + if err != nil { + return nil, fmt.Errorf("cannot render %s: %w", f, err) + } + result[path.Base(f)] = content + } + return result, nil +} + +func (c *renderContext) addManifestFiles(name ...string) { + c.manifestFiles = append(c.manifestFiles, name...) +} + +func (c *renderContext) addManifest(name string, content []byte) { + c.manifests[name] = content +} + +func (c *renderContext) substituteParams(data interface{}, fileName string) ([]byte, error) { + return c.substituteParamsInBytes(data, assets.MustAsset(fileName)) +} + +func (c *renderContext) substituteParamsInBytes(data interface{}, content []byte) ([]byte, error) { + out := &bytes.Buffer{} + t := template.Must(template.New("template").Funcs(c.funcs).Parse(string(content))) + err := t.Execute(out, data) + if err != nil { + return nil, err + } + return out.Bytes(), nil +} + +func applyManifests(ctx context.Context, c client.Client, log logr.Logger, namespace string, manifests map[string][]byte) error { + // Use server side apply for manifestss + applyErrors := []error{} + for manifestName, manifestBytes := range manifests { + if excludeManifests.Has(manifestName) { + continue + } + obj := &unstructured.Unstructured{} + if err := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(manifestBytes), 100).Decode(obj); err != nil { + applyErrors = append(applyErrors, fmt.Errorf("failed to decode manifest %s: %w", manifestName, err)) + } + obj.SetNamespace(namespace) + err := c.Patch(ctx, obj, client.RawPatch(types.ApplyPatchType, manifestBytes), client.ForceOwnership, client.FieldOwner("hypershift-operator")) + if err != nil { + applyErrors = append(applyErrors, fmt.Errorf("failed to apply manifest %s: %w", manifestName, err)) + } else { + log.Info("applied manifest", "manifest", manifestName) + } + } + if errs := errors.NewAggregate(applyErrors); errs != nil { + return fmt.Errorf("failed to apply some manifests: %w", errs) + } + return nil +} diff --git a/hypershift-operator/controllers/infra.go b/hypershift-operator/controllers/infra.go deleted file mode 100644 index 1bf2ca2011ed..000000000000 --- a/hypershift-operator/controllers/infra.go +++ /dev/null @@ -1,393 +0,0 @@ -package controllers - -import ( - "context" - "fmt" - - operatorv1 "github.com/openshift/api/operator/v1" - routev1 "github.com/openshift/api/route/v1" - securityv1 "github.com/openshift/api/security/v1" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/client-go/util/retry" - hyperv1 "openshift.io/hypershift/api/v1alpha1" - ctrl "sigs.k8s.io/controller-runtime/pkg/client" -) - -const ( - kubeAPIServerServiceName = "kube-apiserver" - oauthServiceName = "oauth-openshift" - vpnServiceName = "openvpn-server" - ingressOperatorNamespace = "openshift-ingress-operator" - hypershiftRouteLabel = "hypershift.openshift.io/cluster" - vpnServiceAccountName = "vpn" -) - -type InfrastructureStatus struct { - APIAddress string - OAuthAddress string - VPNAddress string - OpenShiftAPIAddress string - OauthAPIServerAddress string - IgnitionProviderAddress string -} - -func (s InfrastructureStatus) IsReady() bool { - return len(s.APIAddress) > 0 && - len(s.OAuthAddress) > 0 && - len(s.VPNAddress) > 0 && - len(s.IgnitionProviderAddress) > 0 -} - -func (r *HostedControlPlaneReconciler) ensureInfrastructure(ctx context.Context, hcp *hyperv1.HostedControlPlane) (InfrastructureStatus, error) { - status := InfrastructureStatus{} - - targetNamespace := hcp.GetName() - // Ensure that we can run privileged pods - if err := ensureVPNSCC(r, hcp, targetNamespace); err != nil { - return status, fmt.Errorf("failed to ensure privileged SCC for the new namespace: %w", err) - } - - baseDomain, err := ClusterBaseDomain(r.Client, ctx, hcp.Name) - if err != nil { - return status, fmt.Errorf("couldn't determine cluster base domain name: %w", err) - } - - // Create Kube APIServer service - r.Log.Info("Creating Kube API service") - apiService, err := createKubeAPIServerService(r, hcp, targetNamespace) - if err != nil { - return status, fmt.Errorf("failed to create Kube API service: %w", err) - } - r.Log.Info("Created Kube API service") - - r.Log.Info("Creating VPN service") - vpnService, err := createVPNServerService(r, hcp, targetNamespace) - if err != nil { - return status, fmt.Errorf("failed to create vpn server service: %w", err) - } - r.Log.Info("Created VPN service") - - r.Log.Info("Creating Openshift API service") - openshiftAPIService, err := createOpenshiftService(r, hcp, targetNamespace) - if err != nil { - return status, fmt.Errorf("failed to create openshift server service: %w", err) - } - r.Log.Info("Created Openshift API service") - - r.Log.Info("Creating Openshift OAuth API service") - oauthAPIService, err := createOauthAPIService(r, hcp, targetNamespace) - if err != nil { - return status, fmt.Errorf("failed to create openshift oauth api service: %w", err) - } - r.Log.Info("Created Openshift Oauth API service") - - r.Log.Info("Creating OAuth service") - oauthService, err := createOauthService(r, hcp, targetNamespace) - if err != nil { - return status, fmt.Errorf("error creating service for oauth: %w", err) - } - - r.Log.Info("Creating router shard") - if err := createIngressController(r, hcp, targetNamespace, baseDomain); err != nil { - return status, fmt.Errorf("cannot create router shard: %w", err) - } - - r.Log.Info("Creating ignition provider route") - ignitionRoute := createIgnitionServerRoute(r, ctx, targetNamespace) - ignitionRoute.OwnerReferences = ensureHCPOwnerRef(hcp, ignitionRoute.OwnerReferences) - if err := r.Create(ctx, ignitionRoute); err != nil && !apierrors.IsAlreadyExists(err) { - return status, fmt.Errorf("failed to create ignition route: %w", err) - } - - apiAddress, err := getLoadBalancerServiceAddress(r, ctx, ctrl.ObjectKeyFromObject(apiService)) - if err != nil { - return status, fmt.Errorf("failed to get service: %w", err) - } - status.APIAddress = apiAddress - - oauthAddress, err := getLoadBalancerServiceAddress(r, ctx, ctrl.ObjectKeyFromObject(oauthService)) - if err != nil { - return status, fmt.Errorf("failed to get service: %w", err) - } - status.OAuthAddress = oauthAddress - - vpnAddress, err := getLoadBalancerServiceAddress(r, ctx, ctrl.ObjectKeyFromObject(vpnService)) - if err != nil { - return status, fmt.Errorf("failed to get service: %w", err) - } - status.VPNAddress = vpnAddress - - ignitionAddress, err := getRouteAddress(r, ctx, ctrl.ObjectKeyFromObject(ignitionRoute)) - if err != nil { - return status, fmt.Errorf("failed get get route address: %w", err) - } - status.IgnitionProviderAddress = ignitionAddress - - status.OpenShiftAPIAddress = openshiftAPIService.Spec.ClusterIP - status.OauthAPIServerAddress = oauthAPIService.Spec.ClusterIP - - return status, nil -} - -func createKubeAPIServerService(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { - svc := &corev1.Service{} - svc.Namespace = namespace - svc.Name = kubeAPIServerServiceName - svc.Spec.Selector = map[string]string{"app": "kube-apiserver"} - svc.Spec.Type = corev1.ServiceTypeLoadBalancer - svc.Spec.Ports = []corev1.ServicePort{ - { - Port: 6443, - Protocol: corev1.ProtocolTCP, - TargetPort: intstr.FromInt(6443), - }, - } - svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) - if err := client.Create(context.TODO(), svc); err != nil { - if !apierrors.IsAlreadyExists(err) { - return nil, fmt.Errorf("failed to create api server service: %w", err) - } - } - return svc, nil -} - -func createVPNServerService(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { - svc := &corev1.Service{} - svc.Namespace = namespace - svc.Name = vpnServiceName - svc.Spec.Selector = map[string]string{"app": "openvpn-server"} - svc.Spec.Type = corev1.ServiceTypeLoadBalancer - svc.Spec.Ports = []corev1.ServicePort{ - { - Port: 1194, - Protocol: corev1.ProtocolTCP, - TargetPort: intstr.FromInt(1194), - }, - } - svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) - if err := client.Create(context.TODO(), svc); err != nil { - if !apierrors.IsAlreadyExists(err) { - return nil, fmt.Errorf("failed to create vpn server service: %w", err) - } - } - return svc, nil -} - -func createOpenshiftService(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { - svc := &corev1.Service{} - svc.Namespace = namespace - svc.Name = "openshift-apiserver" - svc.Spec.Selector = map[string]string{"app": "openshift-apiserver"} - svc.Spec.Type = corev1.ServiceTypeClusterIP - svc.Spec.Ports = []corev1.ServicePort{ - { - Name: "https", - Port: 443, - Protocol: corev1.ProtocolTCP, - TargetPort: intstr.FromInt(8443), - }, - } - svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) - if err := client.Create(context.TODO(), svc); err != nil { - if apierrors.IsAlreadyExists(err) { - return svc, client.Get(context.TODO(), ctrl.ObjectKeyFromObject(svc), svc) - } else { - return nil, fmt.Errorf("failed to create openshift service: %w", err) - } - } - return svc, nil -} - -func createOauthAPIService(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { - svc := &corev1.Service{} - svc.Namespace = namespace - svc.Name = "openshift-oauth-apiserver" - svc.Spec.Selector = map[string]string{"app": "openshift-oauth-apiserver"} - svc.Spec.Type = corev1.ServiceTypeClusterIP - svc.Spec.Ports = []corev1.ServicePort{ - { - Name: "https", - Port: 443, - Protocol: corev1.ProtocolTCP, - TargetPort: intstr.FromInt(8443), - }, - } - svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) - if err := client.Create(context.TODO(), svc); err != nil { - if apierrors.IsAlreadyExists(err) { - return svc, client.Get(context.TODO(), ctrl.ObjectKeyFromObject(svc), svc) - } else { - return nil, fmt.Errorf("failed to create openshift service: %w", err) - } - } - return svc, nil -} - -func createOauthService(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) (*corev1.Service, error) { - svc := &corev1.Service{} - svc.Namespace = namespace - svc.Name = oauthServiceName - svc.Spec.Selector = map[string]string{"app": "oauth-openshift"} - svc.Spec.Type = corev1.ServiceTypeLoadBalancer - svc.Spec.Ports = []corev1.ServicePort{ - { - Name: "https", - Port: 8443, - Protocol: corev1.ProtocolTCP, - TargetPort: intstr.FromInt(6443), - }, - } - svc.OwnerReferences = ensureHCPOwnerRef(hcp, svc.OwnerReferences) - err := client.Create(context.TODO(), svc) - if err != nil && !apierrors.IsAlreadyExists(err) { - return nil, fmt.Errorf("failed to create oauth service: %w", err) - } - return svc, nil -} - -func createPullSecret(client ctrl.Client, namespace string, data []byte) (*corev1.Secret, error) { - secret := &corev1.Secret{} - secret.Namespace = namespace - secret.Name = pullSecretName - secret.Data = map[string][]byte{".dockerconfigjson": []byte(data)} - secret.Type = corev1.SecretTypeDockerConfigJson - if err := client.Create(context.TODO(), secret); err != nil { - if !apierrors.IsAlreadyExists(err) { - return nil, fmt.Errorf("failed to create pull secret: %w", err) - } - } - return secret, retry.RetryOnConflict(retry.DefaultRetry, func() error { - sa := &corev1.ServiceAccount{} - if err := client.Get(context.TODO(), ctrl.ObjectKey{Namespace: namespace, Name: "default"}, sa); err != nil { - return err - } - sa.ImagePullSecrets = append(sa.ImagePullSecrets, corev1.LocalObjectReference{Name: "pull-secret"}) - if err := client.Update(context.TODO(), sa); err != nil { - return err - } - return nil - }) -} - -func ensureVPNSCC(client ctrl.Client, hcp *hyperv1.HostedControlPlane, namespace string) error { - scc := &securityv1.SecurityContextConstraints{} - if err := client.Get(context.TODO(), ctrl.ObjectKey{Name: "privileged"}, scc); err != nil { - return fmt.Errorf("failed to get privileged scc: %w", err) - } - userSet := sets.NewString(scc.Users...) - svcAccount := fmt.Sprintf("system:serviceaccount:%s:%s", namespace, vpnServiceAccountName) - if userSet.Has(svcAccount) { - return nil - } - userSet.Insert(svcAccount) - scc.Users = userSet.List() - scc.OwnerReferences = ensureHCPOwnerRef(hcp, scc.OwnerReferences) - if err := client.Update(context.TODO(), scc); err != nil { - return fmt.Errorf("failed to update privileged scc: %w", err) - } - return nil -} - -func createIngressController(client ctrl.Client, hcp *hyperv1.HostedControlPlane, name string, parentDomain string) error { - // First ensure that the default ingress controller doesn't use routes generated for hypershift clusters - err := ensureDefaultIngressControllerSelector(client) - if err != nil { - return err - } - ic := &operatorv1.IngressController{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: ingressOperatorNamespace, - }, - Spec: operatorv1.IngressControllerSpec{ - Domain: fmt.Sprintf("apps.%s", parentDomain), - RouteSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - hypershiftRouteLabel: name, - }, - }, - }, - } - ic.OwnerReferences = ensureHCPOwnerRef(hcp, ic.OwnerReferences) - if err := client.Create(context.TODO(), ic); err != nil && !apierrors.IsAlreadyExists(err) { - return fmt.Errorf("failed to create ingress controller for %s: %w", name, err) - } - return nil -} - -func ensureDefaultIngressControllerSelector(client ctrl.Client) error { - defaultIC := &operatorv1.IngressController{} - if err := client.Get(context.TODO(), ctrl.ObjectKey{Namespace: ingressOperatorNamespace, Name: "default"}, defaultIC); err != nil { - return fmt.Errorf("failed to fetch default ingress controller: %w", err) - } - routeSelector := defaultIC.Spec.RouteSelector - if routeSelector == nil { - routeSelector = &metav1.LabelSelector{} - } - found := false - for _, exp := range routeSelector.MatchExpressions { - if exp.Key == hypershiftRouteLabel && exp.Operator == metav1.LabelSelectorOpDoesNotExist { - found = true - break - } - } - if !found { - routeSelector.MatchExpressions = append(routeSelector.MatchExpressions, metav1.LabelSelectorRequirement{ - Key: hypershiftRouteLabel, - Operator: metav1.LabelSelectorOpDoesNotExist, - }) - defaultIC.Spec.RouteSelector = routeSelector - if err := client.Update(context.TODO(), defaultIC); err != nil { - return fmt.Errorf("failed to update default ingress controller: %w", err) - } - } - return nil -} - -func createIgnitionServerRoute(client ctrl.Client, ctx context.Context, namespace string) *routev1.Route { - return &routev1.Route{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: namespace, - Name: "ignition-provider", - }, - Spec: routev1.RouteSpec{ - To: routev1.RouteTargetReference{ - Kind: "Service", - Name: "machine-config-server", - }, - }, - } -} - -func getLoadBalancerServiceAddress(client ctrl.Client, ctx context.Context, key ctrl.ObjectKey) (string, error) { - svc := &corev1.Service{} - if err := client.Get(ctx, key, svc); err != nil { - return "", fmt.Errorf("failed to get service: %w", err) - } - var addr string - if len(svc.Status.LoadBalancer.Ingress) > 0 { - switch { - case svc.Status.LoadBalancer.Ingress[0].Hostname != "": - addr = svc.Status.LoadBalancer.Ingress[0].Hostname - case svc.Status.LoadBalancer.Ingress[0].IP != "": - addr = svc.Status.LoadBalancer.Ingress[0].IP - } - } - return addr, nil -} - -func getRouteAddress(client ctrl.Client, ctx context.Context, key ctrl.ObjectKey) (string, error) { - route := &routev1.Route{} - if err := client.Get(ctx, key, route); err != nil { - return "", fmt.Errorf("failed to get route: %w", err) - } - var addr string - if len(route.Spec.Host) > 0 { - addr = route.Spec.Host - } - return addr, nil -} diff --git a/hypershift-operator/controllers/nodepool_controller.go b/hypershift-operator/controllers/nodepool/nodepool_controller.go similarity index 80% rename from hypershift-operator/controllers/nodepool_controller.go rename to hypershift-operator/controllers/nodepool/nodepool_controller.go index 6195aa04f3b7..c4f63a7c716e 100644 --- a/hypershift-operator/controllers/nodepool_controller.go +++ b/hypershift-operator/controllers/nodepool/nodepool_controller.go @@ -1,8 +1,9 @@ -package controllers +package nodepool import ( "context" "fmt" + "hash/fnv" "time" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -30,10 +31,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" ) +const ( + finalizer = "hypershift.openshift.io/finalizer" +) + type NodePoolReconciler struct { ctrlclient.Client recorder record.EventRecorder - Infra *configv1.Infrastructure Log logr.Logger } @@ -48,12 +52,6 @@ func (r *NodePoolReconciler) SetupWithManager(mgr ctrl.Manager) error { return errors.Wrap(err, "failed setting up with a controller manager") } - var infra configv1.Infrastructure - if err := mgr.GetAPIReader().Get(context.Background(), client.ObjectKey{Name: "cluster"}, &infra); err != nil { - return fmt.Errorf("failed to get cluster infra: %w", err) - } - r.Infra = &infra - r.recorder = mgr.GetEventRecorderFor("nodepool-controller") return nil @@ -79,11 +77,15 @@ func (r *NodePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c if err != nil { return ctrl.Result{}, err } + var infra configv1.Infrastructure + if err := r.Get(context.Background(), client.ObjectKey{Name: "cluster"}, &infra); err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get cluster infra: %w", err) + } // Ignore deleted nodePools, this can happen when foregroundDeletion // is enabled if !nodePool.DeletionTimestamp.IsZero() { - machineSet, _, err := generateScalableResources(r, ctx, r.Infra.Status.InfrastructureName, r.Infra.Status.PlatformStatus.AWS.Region, nodePool, hcluster.GetName()) + machineSet, _, err := generateScalableResources(r, ctx, infra.Status.InfrastructureName, infra.Status.PlatformStatus.AWS.Region, nodePool, hcluster.GetName()) if err != nil { return reconcile.Result{}, fmt.Errorf("failed to generate worker machineset: %w", err) } @@ -115,7 +117,7 @@ func (r *NodePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c return ctrl.Result{}, err } - result, err := r.reconcile(ctx, hcluster, nodePool) + result, err := r.reconcile(ctx, hcluster, &infra, nodePool) if err != nil { r.Log.Error(err, "Failed to reconcile nodePool") r.recorder.Eventf(nodePool, corev1.EventTypeWarning, "ReconcileError", "%v", err) @@ -131,7 +133,7 @@ func (r *NodePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c return result, nil } -func (r *NodePoolReconciler) reconcile(ctx context.Context, hcluster *hyperv1.HostedCluster, nodePool *hyperv1.NodePool) (ctrl.Result, error) { +func (r *NodePoolReconciler) reconcile(ctx context.Context, hcluster *hyperv1.HostedCluster, infra *configv1.Infrastructure, nodePool *hyperv1.NodePool) (ctrl.Result, error) { log := ctrl.LoggerFrom(ctx) log.Info("Reconcile nodePool") @@ -143,7 +145,7 @@ func (r *NodePoolReconciler) reconcile(ctx context.Context, hcluster *hyperv1.Ho }) // Create a machine scalable resources for the new cluster's worker nodes - machineSet, AWSMachineTemplate, err := generateScalableResources(r, ctx, r.Infra.Status.InfrastructureName, r.Infra.Status.PlatformStatus.AWS.Region, nodePool, hcluster.GetName()) + machineSet, AWSMachineTemplate, err := generateScalableResources(r, ctx, infra.Status.InfrastructureName, infra.Status.PlatformStatus.AWS.Region, nodePool, hcluster.GetName()) if err != nil { return reconcile.Result{}, fmt.Errorf("failed to generate worker machineset: %w", err) } @@ -313,3 +315,63 @@ func generateScalableResources(client ctrlclient.Client, ctx context.Context, return machineSet, AWSMachineTemplate, nil } + +func generateMachineSetName(infraName, clusterName, suffix string) string { + return getName(fmt.Sprintf("%s-%s", infraName, clusterName), suffix, 43) +} + +// getName returns a name given a base ("deployment-5") and a suffix ("deploy") +// It will first attempt to join them with a dash. If the resulting name is longer +// than maxLength: if the suffix is too long, it will truncate the base name and add +// an 8-character hash of the [base]-[suffix] string. If the suffix is not too long, +// it will truncate the base, add the hash of the base and return [base]-[hash]-[suffix] +func getName(base, suffix string, maxLength int) string { + if maxLength <= 0 { + return "" + } + name := fmt.Sprintf("%s-%s", base, suffix) + if len(name) <= maxLength { + return name + } + + // length of -hash- + baseLength := maxLength - 10 - len(suffix) + + // if the suffix is too long, ignore it + if baseLength < 0 { + prefix := base[0:min(len(base), max(0, maxLength-9))] + // Calculate hash on initial base-suffix string + shortName := fmt.Sprintf("%s-%s", prefix, hash(name)) + return shortName[:min(maxLength, len(shortName))] + } + + prefix := base[0:baseLength] + // Calculate hash on initial base-suffix string + return fmt.Sprintf("%s-%s-%s", prefix, hash(base), suffix) +} + +// max returns the greater of its 2 inputs +func max(a, b int) int { + if b > a { + return b + } + return a +} + +// min returns the lesser of its 2 inputs +func min(a, b int) int { + if b < a { + return b + } + return a +} + +// hash calculates the hexadecimal representation (8-chars) +// of the hash of the passed in string using the FNV-a algorithm +func hash(s string) string { + hash := fnv.New32a() + hash.Write([]byte(s)) + intHash := hash.Sum32() + result := fmt.Sprintf("%08x", intHash) + return result +} diff --git a/hypershift-operator/main.go b/hypershift-operator/main.go index 1c4204383109..adc35507b8ed 100644 --- a/hypershift-operator/main.go +++ b/hypershift-operator/main.go @@ -21,6 +21,10 @@ import ( "fmt" "os" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + appsv1client "k8s.io/client-go/kubernetes/typed/apps/v1" + "k8s.io/client-go/rest" capiaws "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" configv1 "github.com/openshift/api/config/v1" @@ -28,19 +32,18 @@ import ( routev1 "github.com/openshift/api/route/v1" securityv1 "github.com/openshift/api/security/v1" "github.com/spf13/cobra" - appsv1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/kubernetes" clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" hyperv1 "openshift.io/hypershift/api/v1alpha1" - "openshift.io/hypershift/hypershift-operator/controllers" - "openshift.io/hypershift/hypershift-operator/releaseinfo" + "openshift.io/hypershift/hypershift-operator/controllers/externalinfracluster" + "openshift.io/hypershift/hypershift-operator/controllers/hostedcluster" + "openshift.io/hypershift/hypershift-operator/controllers/nodepool" capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log/zap" // +kubebuilder:scaffold:imports @@ -85,15 +88,19 @@ func NewStartCommand() *cobra.Command { Short: "Runs the Hypershift operator", } + var namespace string + var deploymentName string var metricsAddr string var enableLeaderElection bool - var hostedClusterConfigOperatorImage string + var operatorImage string + cmd.Flags().StringVar(&namespace, "namespace", "hypershift", "The namespace this operator lives in") + cmd.Flags().StringVar(&deploymentName, "deployment-name", "operator", "The name of the deployment of this operator") cmd.Flags().StringVar(&metricsAddr, "metrics-addr", "0", "The address the metric endpoint binds to.") cmd.Flags().BoolVar(&enableLeaderElection, "enable-leader-election", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - cmd.Flags().StringVar(&hostedClusterConfigOperatorImage, "hosted-cluster-config-operator-image", "", "A hosted cluster config operator image.") + cmd.Flags().StringVar(&operatorImage, "operator-image", "", "A specific operator image.") cmd.Run = func(cmd *cobra.Command, args []string) { ctrl.SetLogger(zap.New(zap.UseDevMode(true))) @@ -103,75 +110,75 @@ func NewStartCommand() *cobra.Command { Port: 9443, LeaderElection: enableLeaderElection, LeaderElectionID: "b2ed43ca.hypershift.openshift.io", + // Use a non-caching client everywhere. The default split client does not + // promise to invalidate the cache during writes (nor does it promise + // sequential create/get coherence), and we have code which (probably + // incorrectly) assumes a get immediately following a create/update will + // return the updated resource. All client consumers will need audited to + // ensure they are tolerant of stale data (or we need a cache or client that + // makes stronger coherence guarantees). + NewClient: func(_ cache.Cache, config *rest.Config, options client.Options) (client.Client, error) { + return client.New(config, options) + }, }) if err != nil { setupLog.Error(err, "unable to start manager") os.Exit(1) } - // Add some flexibility to getting the hosted cluster config operator image. Use the - // flag if given, but if that's empty and we're running in a deployment, use the - // hypershift operator's image for the control plane by default. - lookupHostedClusterConfigOperatorImage := func(kubeClient client.Client) (string, error) { - if len(hostedClusterConfigOperatorImage) > 0 { - return hostedClusterConfigOperatorImage, nil + // Add some flexibility to getting the operator image. Use the flag if given, + // but if that's empty and we're running in a deployment, use the + // hypershift operator's image by default. + // TODO: There needs to be some strategy for specifying images everywhere + kubeClient, err := kubernetes.NewForConfig(mgr.GetConfig()) + if err != nil { + setupLog.Error(err, "unable to create kube client") + os.Exit(1) + } + lookupOperatorImage := func(deployments appsv1client.DeploymentInterface, name string) (string, error) { + if len(operatorImage) > 0 { + setupLog.Info("using operator image from arguments") + return operatorImage, nil } - deployment := appsv1.Deployment{} - err := kubeClient.Get(context.TODO(), client.ObjectKey{Namespace: "hypershift", Name: "operator"}, &deployment) + deployment, err := deployments.Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { - if errors.IsNotFound(err) { - return "", nil - } return "", fmt.Errorf("failed to get operator deployment: %w", err) } - var image string for _, container := range deployment.Spec.Template.Spec.Containers { + // TODO: could use downward API for this too, overkill? if container.Name == "operator" { - image = container.Image - break + setupLog.Info("using operator image from deployment") + return container.Image, nil } } - return image, nil + return "", fmt.Errorf("couldn't locate operator container on deployment") } - - kubeClient, err := kubernetes.NewForConfig(mgr.GetConfig()) + operatorImage, err := lookupOperatorImage(kubeClient.AppsV1().Deployments(namespace), deploymentName) if err != nil { - setupLog.Error(err, "unable to create kube client") + setupLog.Error(err, fmt.Sprintf("failed to find operator image: %s", err), "controller", "hypershift") os.Exit(1) } + setupLog.Info("using operator image", "operator-image", operatorImage) - if err = (&controllers.HostedClusterReconciler{ - Client: mgr.GetClient(), - ReleaseProvider: &releaseinfo.PodProvider{ - Pods: kubeClient.CoreV1().Pods("hypershift"), - }, + if err = (&hostedcluster.HostedClusterReconciler{ + Client: mgr.GetClient(), + OperatorImage: operatorImage, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "HostedCluster") os.Exit(1) } - if err := (&controllers.HostedControlPlaneReconciler{ - Client: mgr.GetClient(), - LookupHostedClusterConfigOperatorImage: lookupHostedClusterConfigOperatorImage, - ReleaseProvider: &releaseinfo.PodProvider{ - Pods: kubeClient.CoreV1().Pods("hypershift"), - }, - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "hostedControlPlane") - os.Exit(1) - } - - if err := (&controllers.ExternalInfraClusterReconciler{ + if err := (&nodepool.NodePoolReconciler{ Client: mgr.GetClient(), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "ExternalInfraCluster") + setupLog.Error(err, "unable to create controller", "controller", "nodePool") os.Exit(1) } - if err := (&controllers.NodePoolReconciler{ + if err := (&externalinfracluster.ExternalInfraClusterReconciler{ Client: mgr.GetClient(), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "nodePool") + setupLog.Error(err, "unable to create controller", "controller", "ExternalInfraCluster") os.Exit(1) } diff --git a/test/e2e/quick_start_test.go b/test/e2e/quick_start_test.go index c4a41d6bbfa2..2869c9a1dab3 100644 --- a/test/e2e/quick_start_test.go +++ b/test/e2e/quick_start_test.go @@ -52,7 +52,7 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput) specName = "quick-start" input QuickStartSpecInput - cluster *hyperv1.HostedCluster + namespace *corev1.Namespace ) BeforeEach(func() { @@ -71,22 +71,32 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput) resourceData, err := ioutil.ReadFile(exampleClusterPath) Expect(err).NotTo(HaveOccurred(), "couldn't read example cluster data from %s", exampleClusterPath) + namespace = &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "e2e-", + }, + } + err = input.Client.Create(ctx, namespace) + Expect(err).NotTo(HaveOccurred(), "couldn't create namespace") + Expect(namespace.Name).NotTo(BeEmpty(), "generated namespace has no name") + log.Logf("Created test namespace %s", namespace.Name) + // Apply each resource into the hypershift namespace individually using // a server-side apply resources := strings.Split(string(resourceData), "---\n") for _, resource := range resources { obj := &unstructured.Unstructured{} Expect(yaml.NewYAMLOrJSONDecoder(strings.NewReader(resource), 100).Decode(obj)).To(Succeed(), "couldn't read resource") - obj.SetNamespace("hypershift") + obj.SetNamespace(namespace.Name) err := input.Client.Patch(ctx, obj, ctrl.RawPatch(types.ApplyPatchType, []byte(resource)), ctrl.ForceOwnership, ctrl.FieldOwner("hypershift")) Expect(err).NotTo(HaveOccurred(), "couldn't apply resource") } // Get the actual HostedCluster that was created log.Logf("Waiting for cluster resource to exist") - cluster = &hyperv1.HostedCluster{ + cluster := &hyperv1.HostedCluster{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "hypershift", + Namespace: namespace.Name, Name: "example", }, } @@ -110,6 +120,7 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput) guestKubeConfigSecret := &corev1.Secret{} Eventually(func() bool { key := ctrl.ObjectKey{ + // TODO: This resource needs extracted into a library function Namespace: cluster.GetName(), Name: cluster.Name + "-kubeconfig", } @@ -153,44 +164,29 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput) }) AfterEach(func() { - if cluster != nil { - By("Deleting the example cluster") + if namespace == nil { + return + } + By("Deleting the example cluster namespace") - Expect(input.Client.Delete(ctx, cluster, &ctrl.DeleteOptions{})).To(Succeed(), "couldn't clean up test cluster") + Expect(input.Client.Delete(ctx, namespace, &ctrl.DeleteOptions{})).To(Succeed(), "couldn't clean up test cluster") - By("Ensuring the example cluster resources are deleted") + By("Ensuring the example cluster resources are deleted") - log.Logf("Waiting for guest cluster namespace to be deleted") - Eventually(func() bool { - namespace := &corev1.Namespace{} - key := ctrl.ObjectKey{ - Name: cluster.Name, - } - if err := input.Client.Get(ctx, key, namespace); err != nil { - if errors.IsNotFound(err) { - return true - } - log.Logf("error getting namespace: %s", err) - return false - } - return false - }, 10*time.Minute, 1*time.Second).Should(BeTrue(), "couldn't clean up example cluster namespace") - - log.Logf("Waiting for the cluster resource to be deleted") - Eventually(func() bool { - key := ctrl.ObjectKey{ - Namespace: cluster.Namespace, - Name: cluster.Name, - } - if err := input.Client.Get(ctx, key, cluster); err != nil { - if errors.IsNotFound(err) { - return true - } - log.Logf("error getting cluster: %s", err) - return false + log.Logf("Waiting for the test namespace %q to be deleted", namespace.Name) + Eventually(func() bool { + latestNamespace := &corev1.Namespace{} + key := ctrl.ObjectKey{ + Name: namespace.Name, + } + if err := input.Client.Get(ctx, key, latestNamespace); err != nil { + if errors.IsNotFound(err) { + return true } + log.Logf("error getting namespace %q: %s", latestNamespace.Name, err) return false - }, 10*time.Minute, 1*time.Second).Should(BeTrue(), "couldn't clean up example cluster") - } + } + return false + }, 10*time.Minute, 1*time.Second).Should(BeTrue(), "couldn't clean up example cluster namespace") }) }