zalando / zalando/postgres-operator
operator run failed in outofcluster mod
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
- Which image of the operator are you using?
Run postgres operator binary cmd with outofcluster flag directly as follows
./cmd --kubeconfig=/home/xxx/.kube/kubeconfig --outofcluster
- Where do you run it - cloud or metal? Kubernetes or OpenShift?
Bare Metal K8s - Are you running Postgres Operator in production?
no - Type of issue?
question, may be a bug report
When operator run in outofcluster mod, it start failed with message
INFO[0000] Spilo operator
INFO[0000] no ConfigMap specified. Loading default values pkg=controller
2021/02/18 17:17:50 Unable to detect operator namespace from within its pod due to: open /var/run/secrets/kubernetes.io/serviceaccount/namespace: no such file or directory
I found the help message about the --outofcluster is Whether the operator runs in- our outside of the Kubernetes cluster. In my opinion, outofcluster means for run operator binay command out of k8s cluster directly, and communicate with apiserver with kubeconfig, not need a pod in cluster.
Buf in fact, in outofcluster mod the operator still try to parse operator namespace use /var/run/secrets/kubernetes.io/serviceaccount/namespace which mounted and exist in a pod. Is my understanging wrong or a bug when operator run out of cluster ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure using ./cmd --kubeconfig=/home/xxx/.kube/kubeconfig --outofcluster outside Kubernetes and inspect the operator's namespace detection path. Check whether the service-account namespace lookup is expected in this mode or whether the kubeconfig should suffice. Done means the intended out-of-cluster behavior is established and covered by an appropriate regression test or clarified documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100