cockroachdb / cockroachdb/cockroach-operator

operator status is ready before it's able to accept admission webhooks.

Open
#957 2 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Go
Stars
318
Forks
104
Avg merge
1d 6h
Merged PRs (30d)
1

Description

I have a script that attempts to install the operator and create a db that looks something like:

```
kubectl apply -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.10.0/install/crds.yaml
kubectl apply -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.10.0/install/operator.yaml
kubectl wait --for=condition=Ready pods --all -n cockroach-operator-system --timeout=5m

kubectl apply -k ./overlays/cockroach
```

Results in:
```
customresourcedefinition.apiextensions.k8s.io/crdbclusters.crdb.cockroachlabs.com created
namespace/cockroach-operator-system created
serviceaccount/cockroach-operator-sa created
clusterrole.rbac.authorization.k8s.io/cockroach-operator-role created
clusterrolebinding.rbac.authorization.k8s.io/cockroach-operator-rolebinding created
service/cockroach-operator-webhook-service created
deployment.apps/cockroach-operator-manager created
mutatingwebhookconfiguration.admissionregistration.k8s.io/cockroach-operator-mutating-webhook-configuration created
validatingwebhookconfiguration.admissionregistration.k8s.io/cockroach-operator-validating-webhook-configuration created
pod/cockroach-operator-manager-75fff59c94-j6qvp condition met
...
Error from server (InternalError): error when creating "./overlays/cockroach": Internal error occurred: failed calling webhook "mcrdbcluster.kb.io": failed to call webhook: Post "https://cockroach-operator-webhook-service.cockroach-operator-system.svc:443/mutate-crdb-cockroachlabs-com-v1alpha1-crdbcluster?timeout=10s": dial tcp 10.96.201.111:443: connect: connection
```

Is there a better way to wait for the operator to be ready before trying to create crdb resources?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the sequence using install/crds.yaml, install/operator.yaml, and the kubectl wait command shown in the issue. Inspect the operator pod, webhook service, and admission webhook readiness behavior; done means the documented or implemented readiness check prevents CRDB resources from being submitted until admission webhooks accept them.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.