0

I have a k3s installation with cert-manager set up with a cloudflare dns01 solver:

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    # The ACME server URL
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    # Email address used for ACME registration
    email: josste@<domain-redacted>
    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-staging
    # Enable the HTTP-01 challenge provider
    solvers:
    - dns01:
        cloudflare:
          email: josste@<domain-redacted>
          apiTokenSecretRef:
            name: cloudflare-api-token-secret
            key: api-token

"Working" ingress config:

This ingress config creates an ingress but it doesn't work since the service is in another namespace.

Do I have to redeploy all my applications in the default namespace, or can I do something different in order to create an ingress and certificate in another namespace than the one the cert-manager is deployed to?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: home-assistant-ssl
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/issuer: "letsencrypt-staging"
  namespace: cert-manager
  #namespace: homeassistant

spec:
  tls:
  - hosts:
    - kuard.k8s.<domain-redacted>
    secretName: ha-ingress-tls-secret
#    issuerRef:
  rules:
  - host: ha.k8s.<domain-redacted>
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: home-assistant
            port:
              number: 38123

Working certificate in cert-manager namespace

Events:
  Type    Reason              Age    From                                                Message
  ----    ------              ----   ----                                                -------
  Normal  WaitingForApproval  5m41s  cert-manager-certificaterequests-issuer-ca          Not signing CertificateRequest until it is Approved
  Normal  WaitingForApproval  5m41s  cert-manager-certificaterequests-issuer-venafi      Not signing CertificateRequest until it is Approved
  Normal  WaitingForApproval  5m41s  cert-manager-certificaterequests-issuer-selfsigned  Not signing CertificateRequest until it is Approved
  Normal  WaitingForApproval  5m41s  cert-manager-certificaterequests-issuer-acme        Not signing CertificateRequest until it is Approved
  Normal  WaitingForApproval  5m41s  cert-manager-certificaterequests-issuer-vault       Not signing CertificateRequest until it is Approved
  Normal  cert-manager.io     5m41s  cert-manager-certificaterequests-approver           Certificate request has been approved by cert-manager.io
  Normal  OrderCreated        5m41s  cert-manager-certificaterequests-issuer-acme        Created Order resource cert-manager/quickstart-example5-tls-plzgs-4107058996
  Normal  OrderPending        5m41s  cert-manager-certificaterequests-issuer-acme        Waiting on certificate issuance from order cert-manager/quickstart-example5-tls-plzgs-4107058996: ""
  Normal  CertificateIssued   4m19s  cert-manager-certificaterequests-issuer-acme        Certificate fetched from issuer successfully

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.