Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy-webhook-certs secrets are not getting created #41

Closed
MageshSrinivasulu opened this issue Jun 17, 2022 · 7 comments
Closed

policy-webhook-certs secrets are not getting created #41

MageshSrinivasulu opened this issue Jun 17, 2022 · 7 comments
Labels
question Further information is requested

Comments

@MageshSrinivasulu
Copy link

MageshSrinivasulu commented Jun 17, 2022

Can someone please provide details on how these secrets are getting populated? I my case its not showing. webhook-certs are working fine

policy-webhook-certs :

kubectl describe secret policy-webhook-certs
Name:         policy-webhook-certs
Labels:       app.kubernetes.io/instance=policy-controller
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=policy-controller
              app.kubernetes.io/version=1.9.0
              control-plane=policy-controller-policy-webhook
              helm.sh/chart=policy-controller-0.1.25
Annotations:  meta.helm.sh/release-name: policy-controller

Type:  Opaque

Data
====

webhook-certs :

kubectl describe secret webhook-certs
Name:         webhook-certs
Labels:       app.kubernetes.io/instance=policy-controller
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=policy-controller
              app.kubernetes.io/version=1.9.0
              control-plane=policy-controller-webhook
              helm.sh/chart=policy-controller-0.1.25
Annotations:  meta.helm.sh/release-name: policy-controller

Type:  Opaque

Data
====
server-cert.pem:  794 bytes
server-key.pem:   241 bytes
ca-cert.pem:      855 bytes
@MageshSrinivasulu MageshSrinivasulu added the question Further information is requested label Jun 17, 2022
@hectorj2f
Copy link
Collaborator

@MageshSrinivasulu could you explain how you install the code? I haven’t experienced the certificates issues when using ko to apply the code in main.

On the other hand, the certificate generation is done via https://knative.dev/docs/serving/using-auto-tls/

@MageshSrinivasulu
Copy link
Author

@hectorj2f I am just performing helm install on this https://github.com/sigstore/helm-charts/tree/main/charts/policy-controller. I didn't make any specific changes to helm values

@hectorj2f
Copy link
Collaborator

@MageshSrinivasulu i have faced this issue before we might be hitting a race condition. We will need to replicate it. Perhaps you could delete/install it again including the resources in that namespace. Are ypu installing it on kind ?

@MageshSrinivasulu
Copy link
Author

MageshSrinivasulu commented Jun 17, 2022

@MageshSrinivasulu i have faced this issue before we might be hitting a race condition. We will need to replicate it. Perhaps you could delete/install it again including the resources in that namespace. Are ypu installing it on kind ?

@hectorj2f When you mean delete/install it's only policy-controller right ? not the other resources in that namespaces. I have tried it multiple times but it's the same.

We are installing it on AKS using Terraform

@hectorj2f
Copy link
Collaborator

@MageshSrinivasulu I remember discussing with you this issue in our helm-charts repo. I am sharing a gist of it here sigstore/helm-charts#217:

The certificates are not created because the leases (kubectl get leases) are not cleaned up for the webhooks. I managed to reproduce it by installing and deleting the chart.

I feel the solution could be one of these three:

* delete the namespace where you installed the policy-controller chart when uninstalling it, if possible.
* delete the leases before every re-installation.
* wait until the leases expire (approx. 10min after creation)
* create your own certs instead of relying on the auto-TLS
``

@hectorj2f
Copy link
Collaborator

Closing the issue for now. Feel free to re-open it.

@gustavoromerobenitez
Copy link

gustavoromerobenitez commented Mar 31, 2023

This issue is still present. The policy-webhook-certs secret contains no data and despite deleting the namespace and re-installing the helm chart, the issue re-appears.

The policy-webhook crashes with this error:

http: TLS handshake error from <NodeIP>:<EphemeralPort>: tls: no certificates configured

policy-controller AppVersion: 0.7.0
policy-controller Helm Chart version: 0.5.4
Kubernetes (GKE) version: 1.24.9-gke.3200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants