Closed mylesagray closed 2 years ago
Thanks for doing this. I was running the operator through go, so not seeing this error.
I've patched it a the source, instead of in the generated files at: 873e478
If you and @frundh want to use this software and see it maintained, may I suggest that you become sponsors on GitHub? Pick whatever tier you think is reasonable for the value and time savings you are getting.
Alex
Closing as fixed
I appreciate you fixing it in the source - but the spirit of this issue was that the manifest.yaml
is broken OOTB for anyone deploying it and i'm sure @frundh would agree here as this was also the spirit of his PR - so I would argue that this should be re-opened, even as an FYI for other people that will inevitably hit this issue if indeed there is an upstream issue that needs fixed.
Right now, I am just pointing people that use it to a manifest I have forked and removed the offending lines from to get them running.
It's fixed? What problem are you running into now?
The same one as before - repo info below:
β― kind create cluster --image=kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
Creating cluster "kind" ...
β Ensuring node image (kindest/node:v1.19.11) πΌ
β Preparing nodes π¦
β Writing configuration π
β Starting control-plane πΉοΈ
β Installing CNI π
β Installing StorageClass πΎ
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Have a nice day! π
β― k apply -f https://raw.githubusercontent.com/alexellis/registry-creds/master/manifest.yaml
namespace/registry-creds-system created
customresourcedefinition.apiextensions.k8s.io/clusterpullsecrets.ops.alexellis.io created
role.rbac.authorization.k8s.io/registry-creds-leader-election-role created
clusterrole.rbac.authorization.k8s.io/registry-creds-registry-creds-role created
rolebinding.rbac.authorization.k8s.io/registry-creds-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/registry-creds-registry-creds-rolebinding created
deployment.apps/registry-creds-registry-creds-controller created
β― k get po -n registry-creds-system -w
NAME READY STATUS RESTARTS AGE
registry-creds-registry-creds-controller-75d6696656-djskn 0/1 ContainerCreating 0 12s
registry-creds-registry-creds-controller-75d6696656-djskn 1/1 Running 0 13s
^C%
β― k logs -n registry-creds-system registry-creds-registry-creds-controller-75d6696656-djskn -f
2021-12-13T13:56:08.943Z INFO controller-runtime.metrics metrics server is starting to listen {"addr": ":8080"}
2021-12-13T13:56:08.944Z INFO setup starting manager with the version %s and commit %s {"0.3.1": "9a617dafeb621c0dc09bb133b6163f68afc920cf"}
I1213 13:56:08.945026 1 leaderelection.go:242] attempting to acquire leader lease registry-creds-system/8bdecb1a.alexellis.io...
2021-12-13T13:56:08.945Z INFO controller-runtime.manager starting metrics server {"path": "/metrics"}
E1213 13:56:08.976261 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:12.437712 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:16.707244 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:20.311260 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:23.368801 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:26.402875 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:30.060973 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:32.232297 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:34.618701 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:36.865718 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:39.596546 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
E1213 13:56:42.841256 1 leaderelection.go:335] error initially creating leader election record: configmaps is forbidden: User "system:serviceaccount:registry-creds-system:default" cannot create resource "configmaps" in API group "" in the namespace "registry-creds-system"
Bizarre. I fixed it, it worked fine for me and I mentioned that when closing. I'll have another look.
$ kind create cluster
Creating cluster "kind" ...
β Ensuring node image (kindest/node:v1.21.1) πΌ
β Preparing nodes π¦
β Writing configuration π
β Starting control-plane πΉοΈ
β Installing CNI π
β Installing StorageClass πΎ
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community π
$ source ~/.docker-creds
$
$ kubectl create secret docker-registry registry-creds \
> --namespace kube-system \
> --docker-username=$DOCKER_USERNAME \
> --docker-password=$DOCKER_PASSWORD \
> --docker-email=$DOCKER_EMAIL
secret/registry-creds created
$
$ kubectl apply -f ./manifest.yaml
$ kubectl apply -f ../test.yaml
clusterpullsecret.ops.alexellis.io/dockerhub-registry-creds created
$ kubectl create ns test
namespace/test created
$ kubectl get secret -n test
NAME TYPE DATA AGE
default-token-fcvdb kubernetes.io/service-account-token 3 3s
dockerhub-registry-creds kubernetes.io/dockerconfigjson 1 3s
$
But are you still going to keep using this without sponsoring me for the time and support I'm providing?
Describe the bug K8s clusters tested on ARM from v1.18 thru v1.21, x86 vanilla with the same versions - and multiple Tanzu cluster versions, this failure is also described in the PR #31 in which is fails on IKS on IBM Cloud.
When applying the
manifest.yaml
via the following - the system will never start up with a failed leader election:Error from the pod:
To Reproduce Create KinD cluster:
Install reg-creds:
Check reg-creds pod logs:
Expected behavior The leader election to succeed and the system to run.
List all possible solutions, and your suggested option
Removing the lines: https://github.com/alexellis/registry-creds/blob/873e47849c983d48e16f27c3e38947f941a3288d/manifest.yaml#L88-L89
Solves the issue instantly:
My comment here shows the same response as this being the fix for multiple users: https://github.com/alexellis/registry-creds/issues/16#issuecomment-778186442