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

Certificate error due to invalid name in FluxCD HelmRelease installation #1299

Closed
heytrav opened this issue Dec 16, 2024 · 5 comments
Closed
Assignees
Labels
bug Something isn't working good first issue Good for newcomers helm

Comments

@heytrav
Copy link
Contributor

heytrav commented Dec 16, 2024

Bug description

When installing capsule in FluxCD as a HelmRelease all services automatically get the HelmRelease name as a prefix. This is incompatible with the certificate generated internally.

 Warning  ReconciliationFailed     13s (x10 over 8m14s)  kustomize-controller  Namespace/ingress-nginx dry-run failed (InternalError): Internal error occurred: failed calling webhook "owner.name
space.projectcapsule.dev": failed to call webhook: Post "https://capsule-capsule-webhook-service.capsule.svc:443/namespace-owner-reference?timeout=30s": tls: failed to verify certificate: x509: c
ertificate is valid for capsule-webhook-service.capsule.svc, not capsule-capsule-webhook-service.capsule.s

How to reproduce

I'm installing capsule as a HelmRelease with the following yaml

---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: capsule
  namespace: flux-system
spec:
  chart:
    spec:
      chart: capsule
      reconcileStrategy: ChartVersion
      sourceRef:
        kind: HelmRepository
        name: projectcapsule
      version: '>=0.7.2 < 0.8.0'
  install:
    crds: Create
    createNamespace: true
    remediation:
      retries: -1
  interval: 5m0s
  targetNamespace: capsule
  upgrade:
    crds: CreateReplace

The ingress-nginx controller which installs a little earlier attempts to make a webhook call to capsule and fails with the error mentioned earlier

Expected behavior

I'm trying to find some way to add an additional name into SANS but so far have not been able to find something in the helm chart values.

Logs

If applicable, please provide logs of capsule.

In a standard stand-alone installation of Capsule,
you'd get this by running kubectl -n capsule-system logs deploy/capsule-controller-manager.

Additional context

  • Helm Chart version: 0.7.2
@heytrav heytrav added blocked-needs-validation Issue need triage and validation bug Something isn't working labels Dec 16, 2024
@prometherion prometherion added good first issue Good for newcomers helm and removed blocked-needs-validation Issue need triage and validation labels Dec 18, 2024
@prometherion
Copy link
Member

We should make this configurable, or fixed:

dnsNames:
- {{ include "capsule.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc
- {{ include "capsule.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc.cluster.local

Are you up for a contribution? New contributors are always welcomed! 🫂 🤗

@heytrav
Copy link
Contributor Author

heytrav commented Dec 18, 2024

Ah that's the line I was looking for. I'll see if I can do something with this in the next few days.
Thanks!

@heytrav
Copy link
Contributor Author

heytrav commented Dec 19, 2024

I've created #1303 but after playing around with the helm chart I don't know if it's necessary.

In my case it looks like setting

fullnameOverride: capsule-capsule
certManager:
  generateCertificates: true

Solves the problem. I'll submit that PR anyway in case it might also be useful to be able to set additional SANS.

@prometherion
Copy link
Member

I'll submit that PR anyway in case it might also be useful to be able to set additional SANS

Loving it, thanks! ❤️

@prometherion
Copy link
Member

Closed via #1303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers helm
Projects
None yet
Development

No branches or pull requests

2 participants