aws / karpenter-provider-aws

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
https://karpenter.sh
Apache License 2.0
6.62k stars 923 forks source link

TLS Error with Karpenter Liveness and Readiness Probes: remote error: tls: unrecognized name #7027

Open oluranticode opened 2 days ago

oluranticode commented 2 days ago

Description

Observed Behavior:

I am deploying Karpenter on my EKS cluster via ArgoCD, and I am encountering TLS errors on the liveness and readiness probes. The errors are as follows:

Readiness probe failed: Get "https://10.0.x.x:8443/": remote error: tls: unrecognized name Liveness probe failed: Get "https://10.0.x.x:8443/": remote error: tls: unrecognized name

I have set up a wildcard DNS for *.mydomain.com, and Karpenter is using a TLS certificate with karpenter.mydomain.com as the common name (CN). Despite my configuration, the probes keep failing due to a TLS handshake issue.

Expected Behavior:

The probes should pass successfully without TLS errors, and the liveness and readiness checks should not fail due to mismatched certificate names.

Reproduction Steps (Please include YAML):

Deploy Karpenter using Helm via ArgoCD. Configure TLS with a cert-manager Certificate for karpenter.mydomian.com. Apply readiness and liveness probes using the service IP (10.0.x.x). Observe the repeated TLS errors in the pod logs.

apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: karpenter namespace: argocd spec: project: system source: repoURL: 'https://charts.karpenter.sh' chart: karpenter targetRevision: {{ index .Values "targetRevision" "karpenter" }} helm: values: | clusterName: "cliniify-cluster" clusterEndpoint: "https://A1B2C3D4E$%RF6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0.us-west-2.eks.amazonaws.com" defaultInstanceProfile: "KarpenterInstanceProfile" controller: livenessProbe: httpGet: scheme: HTTPS host: karpenter.kube-system.svc.cluster.local # Service DNS port: 8443 httpHeaders:

Versions: karpenter: 0.16.3

apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: karpenter-cert namespace: kube-system spec: secretName: karpenter-tls duration: 24h renewBefore: 12h commonName: karpenter.mydomain.com dnsNames:

njtran commented 2 days ago

Looks like you're on v1.0.0. You should try v1.0.2 as the latest patch version for v1.0.

Additionally, do you have this secret? https://github.com/aws/karpenter-provider-aws/blob/v1.0.2/charts/karpenter/templates/secret-webhook-cert.yaml