hey guys, I'll really appreciate help for this! I'...
# general
q
hey guys, I'll really appreciate help for this! I'm installing a CloudNative Postgres Operator using ansible, and after installing it, i also try to create a cluster, but then i receive this error for example on my RKE2 cluster: Failed to create object: b''{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Internal error occurred: failed calling webhook \\"mcluster.cnpg.io\\": failed to call webhook: Post \\"https://cnpg-webhook-service.cnpg-system.svc:443/mutate-postgresql-cnpg-io-v1-cluster?timeout=10s\\": proxy error from 127.0.0.1:9345 while dialing <serverip>:9443, code 502: 502 Bad Gateway","reason":"InternalError","details":{"causes":[{"message":"failed calling webhook \\"mcluster.cnpg.io\\": failed to call webhook: Post \\"https://cnpg-webhook-service.cnpg-system.svc:443/mutate-postgresql-cnpg-io-v1-cluster?timeout=10s\\": proxy error from 127.0.0.1:9345 while dialing <serverip>:9443, code 502: 502 Bad Gateway"}]},"code":500}\n''' reason: Internal Server Error: now thing is - at the beginning i took my RKE2 nodes' rke2.yaml and changed the "server:" value of it under the "clusters:", and changed it from 127.0.0.1 to my <serverip> value, and restarted the rke2 service and it made it work! however now when i try to do so, the "server:" value keeps getting reverted back to 127.0.0.1 so I figured it may not be the best approach to fix it. I will appreciate any help to what I can do here and why it may happen, thanks alot!
c
1. Don't change the admin kubeconfig, thats not the correct fix. It'll get reverted every startup 2. Why is the webhook configured to expect the webhook backend to be running on a node port on a specific node? Did you do something to the chart values to do this? The webhook should run as a ClusterIP service and the config should point at it by name. The webhook service endpoints shouldn't point at a node IP....
tldr you have set up the cpng webhook service really weird.