11:13:56-0700 yagody $ kubectl version Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"archive", BuildDate:"2021-09-16T09:21:16Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"} 11:14:03-0700 yagody $ operator-sdk olm install INFO[0000] Fetching CRDs for version "latest" ... 11:38:27-0700 yagody $ kubectl apply -f /tmp/opertest/operatorGroup.yaml operatorgroup.operators.coreos.com/og-single created 11:38:36-0700 yagody $ kubectl apply -f /tmp/opertest/kongSubscription.yaml subscription.operators.coreos.com/kong created 11:38:45-0700 yagody $ kubectl get sub -n default NAME PACKAGE SOURCE CHANNEL kong kong operatorhubio-catalog alpha 11:39:18-0700 yagody $ kubectl get csv -n default NAME DISPLAY VERSION REPLACES PHASE kong.v0.8.0 Kong Operator 0.8.0 kong.v0.7.0 Succeeded 11:39:27-0700 yagody $ kubectl get deployment -n default NAME READY UP-TO-DATE AVAILABLE AGE kong-operator 1/1 1 1 36s 11:39:35-0700 yagody $ kubectl apply -f /tmp/opertest/0_8_0_charts_v1alpha1_kong_cr.yaml kong.charts.helm.k8s.io/example-kong created 11:41:34-0700 yagody $ kubectl apply -f https://bit.ly/echo-service service/echo created deployment.apps/echo created 11:42:47-0700 yagody $ kubectl apply -f /tmp/opertest/ingress.yaml ingress.networking.k8s.io/demo created 11:43:09-0700 yagody $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE echo 1/1 1 1 79s example-kong-kong 1/1 1 1 2m6s kong-operator 1/1 1 1 4m47s 11:43:00-0700 yagody $ kubectl port-forward example-kong-kong-7cb64c5bcc-xzn74 8000:8000 Forwarding from 127.0.0.1:8000 -> 8000 Forwarding from [::1]:8000 -> 8000 Handling connection for 8000 11:43:46-0700 yagody $ curl -s localhost:8000/foo Hostname: echo-5fc5b5bc84-f77tb ... 11:44:41-0700 yagody $ kubectl apply -f /tmp/opertest/another_0_8_0_charts_v1alpha1_kong_cr.yaml kong.charts.helm.k8s.io/another-kong created 11:49:09-0700 yagody $ kubectl apply -f /tmp/opertest/anotherIngress.yaml ingress.networking.k8s.io/demo configured 11:49:49-0700 yagody $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE another-kong-kong 1/1 1 1 40s echo 1/1 1 1 7m28s example-kong-kong 1/1 1 1 8m15s kong-operator 1/1 1 1 10m 11:49:38-0700 yagody $ kubectl port-forward another-kong-kong-79bc86dc45-vs5j8 8000:8000 ... 11:49:55-0700 yagody $ curl -s localhost:8000/bar Hostname: echo-5fc5b5bc84-f77tb ... 12:06:11-0700 yagody $ kubectl get kongs.charts.helm.k8s.io --all-namespaces -o json | jq ".items[] | del(.metadata.uid, .metadata.creationTimestamp, .metadata.generation, .metadata.resourceVersion) | .apiVersion=\"charts.konghq.com/v1alpha1\"" > /tmp/opertest/kongs_new_cr.yaml 12:07:11-0700 yagody $ kubectl delete kongs --all-namespaces --all kong.charts.helm.k8s.io "another-kong" deleted kong.charts.helm.k8s.io "example-kong" deleted 12:07:19-0700 yagody $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE echo 1/1 1 1 25m kong-operator 1/1 1 1 3m38s 12:08:15-0700 yagody $ kubectl delete subscription kong subscription.operators.coreos.com "kong" deleted 12:08:33-0700 yagody $ kubectl delete csv kong.v0.8.0 clusterserviceversion.operators.coreos.com "kong.v0.8.0" deleted 12:08:36-0700 yagody $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE echo 1/1 1 1 26m 12:11:15-0700 yagody $ kubectl delete crd kongs.charts.helm.k8s.io customresourcedefinition.apiextensions.k8s.io "kongs.charts.helm.k8s.io" deleted # Attempting to test OLM install of the new version without actually publishing it failed. # I attempted to follow their test instructions, but the old version (0.18 since the 0.17 docs aren't rendered) # does not appear to support the latest CRD API version when building its local OLM whatever # https://sdk.operatorframework.io/docs/olm-integration/testing-deployment/ # https://v0-18-x.sdk.operatorframework.io/docs/olm-integration/olm-deployment/ 12:35:17-0700 yagody $ /tmp/operator-sdk-v0.17.2 run packagemanifests --olm --operator-version 0.9.0 ... FATA[0000] Failed to run operator using OLM: error initializing operator manager: bundle dir had errors: [{ [Error: Value error getting bundles from manifests dir "deploy/olm-catalog/kong-operator": [error checking provided apis in bundle : error decoding CRD: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1" in scheme "pkg/runtime/scheme.go:101", error adding operator bundle : error getting bundle CSV: error decoding CRD: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1" in scheme "pkg/runtime/scheme.go:101"]: parse manifests from "deploy/olm-catalog/kong-operator"] []}] # The 1.x operator-sdk tooling does support the new API, but not work with 0.x projects. # I performed a manual install by copying build/Dockerfile to the root of the repo, building an image, # loading it with "kind load docker-image kong-oper-tmp:0.9.0", and manually creating resources that OLM # would normally create as shown below. I modified the Deployment slightly to account for the non-standard image. 13:32:01-0700 yagody $ kubectl create namespace kong namespace/kong created 13:32:19-0700 yagody $ kubectl create -f ~/src/kong-operator/deploy/service_account.yaml -f ~/src/kong-operator/deploy/role.yaml -f ~/src/kong-operator/deploy/role_binding.yaml serviceaccount/kong-operator created clusterrole.rbac.authorization.k8s.io/kong-operator created clusterrolebinding.rbac.authorization.k8s.io/kong-operator created 13:32:22-0700 yagody $ kubectl create -f ~/src/kong-operator/deploy/crds/charts_v1alpha1_kong_crd.yaml customresourcedefinition.apiextensions.k8s.io/kongs.charts.konghq.com created 13:34:10-0700 yagody $ kubectl create -f /tmp/opertest/kongs_new_cr.yaml kong.charts.konghq.com/another-kong created kong.charts.konghq.com/example-kong created 13:52:04-0700 yagody $ kubectl create -f /tmp/opertest/deployment.yaml deployment.apps/kong-operator created 13:52:12-0700 yagody $ kubectl get deploy -n kong NAME READY UP-TO-DATE AVAILABLE AGE kong-operator 1/1 1 1 15s 13:52:32-0700 yagody $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE another-kong-kong 1/1 1 1 18s echo 1/1 1 1 130m example-kong-kong 1/1 1 1 11s 13:52:41-0700 yagody $ curl -s localhost:8000/bar Hostname: echo-5fc5b5bc84-f77tb ...