quarkus-operator-sdk
quarkus-operator-sdk copied to clipboard
Doc improvement for k8s users
Improvement
The following wording Connect to your cluster of choice using kubectl/oc, select the appropriate namespace/project. The operator will automatically connect to that cluster/namespace combination when started. should be improved as we cannot select a default namespace (= openshift project) as we can do with openshift.
The following command should be then included within the README document kubectl config set-context --current --namespace=my-namespace executed before to start the java operator.
We could also add the command oc project my-project for the openshift users
If we dont do that top of k8s, when we will deploy the jokerequest crd, then the following error will occur
ERROR [io.jav.ope.pro.EventDispatcher] (EventHandler-jokecontroller)
Error during event processing ExecutionScope{
events=[CustomResourceEvent{action=MODIFIED,
resource=[ name=jr-any, kind=JokeRequest, apiVersion=samples.javaoperatorsdk.io/v1alpha1 ,resourceVersion=712, markedForDeletion: false ]},
{ class=io.javaoperatorsdk.operator.processing.event.internal.TimerEvent, relatedCustomResourceUid=bbeb5faa-f7c2-4eda-9212-f394e505591f, eventSource=io.javaoperatorsdk.operator.processing.event.internal.TimerEventSource@1af63c2d }, { class=io.javaoperatorsdk.operator.processing.event.internal.TimerEvent, relatedCustomResourceUid=bbeb5faa-f7c2-4eda-9212-f394e505591f, eventSource=io.javaoperatorsdk.operator.processing.event.internal.TimerEventSource@1af63c2d }, { class=io.javaoperatorsdk.operator.processing.event.internal.TimerEvent, relatedCustomResourceUid=bbeb5faa-f7c2-4eda-9212-f394e505591f, eventSource=io.javaoperatorsdk.operator.processing.event.internal.TimerEventSource@1af63c2d }], customResource uid: bbeb5faa-f7c2-4eda-9212-f394e505591f, version: 712} failed.:
io.fabric8.kubernetes.client.KubernetesClientException: Namespace not specified. But operation requires namespace.
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.checkNamespace(OperationSupport.java:184)
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:262)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:870)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:365)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:86)
at io.quarkiverse.operatorsdk.samples.joke.JokeController.createOrUpdateResource(JokeController.java:69)
at io.quarkiverse.operatorsdk.samples.joke.JokeController.createOrUpdateResource(JokeController.java:33)
Presumably people writing operators know how to connect to a cluster… 😁
Personally, I test with kind and I use kubectx/kubens to deal with connecting to the cluster.
Feel free to open a PR, though!