ZeroSSL로 Ingress 보호하기
ZeroSSL Issuer 유형을 사용해 Kubernetes Ingress 리소스를 보호하는 방법을 다루는 튜토리얼이에요. EAB 자격 증명 생성부터 cert-manager 설치, ClusterIssuer 생성, 인증서 발급 확인까지의 전체 과정을 안내해요.
출처: 문서
본문
예정된 변경 사항: ingress-nginx는 2026년 3월에 수명 종료될 예정입니다. 마이그레이션 지침과 Gateway API 계획은 Ingress-nginx 수명 종료: cert-manager가 오늘 지원하는 것과 앞으로의 것 (/announcements/2025/11/26/ingress-nginx-eol-and-gateway-api/)을 참조하세요.
ZeroSSL
이 가이드는 ZeroSSL Issuer 유형을 사용하여 Kubernetes Ingress (https://kubernetes.io/docs/concepts/services-networking/ingress/) 리소스를 보호하는 방법을 안내합니다.
ZeroSSL은 Let's Encrypt 및 그 경쟁사와 마찬가지로 무료 90일 인증서를 만들 수 있습니다. 필요한 것은 https://zerossl.com/ (https://zerossl.com/)에서 계정을 만드는 것입니다. 그런 다음 개발자 섹션으로 이동하여 EAB Credentials for ACME Clients를 생성합니다. 나중에 필요할 것입니다.
참고하세요!
EAB 자격 증명은 계정에 저장되지 않으므로 어딘가에 메모해 두세요. "Generate"를 클릭할 때마다 새 자격 증명 세트가 생성됩니다. 여러 자격 증명을 만들어도 모두 계속 작동합니다.
사전 요구 사항
-
AWS 계정
-
kubectl 설치
-
공개 등록된 DNS 영역에 대한 접근
-
Kubernetes 클러스터(AWS EKS 사용 가능)
-
클러스터 내에 배포되고 작동하는 ingress-nginx (https://kubernetes.github.io/ingress-nginx/)
튜토리얼 시나리오:
cert-manager 설치
cert-manager 1.8.2+/1.7.3+를 사용해야 합니다. 자세한 내용은 링크 (https://github.com/cert-manager/cert-manager/pull/5226)를 참조하세요.
설치 가이드를 따라 진행하고 cert-manager가 올바르게 배포되었는지 확인한 후 이 단계로 돌아오세요. Kubernetes에서 실행 (/docs/installation/helm/)의 단계에 따라 k8s에 설치합니다.
ZeroSSL로 자동 전환하려면 values 파일에 다음 구성을 추가하여 기본 shim을 설정하는 것이 좋습니다.
ingressShim:
defaultIssuerName: "zerossl-production"
defaultIssuerKind: "ClusterIssuer"
crds:
enabled: true
helm을 사용하여 설치합니다.
helm upgrade --install --namespace cert-manager --version v1.21.2 cert-manager oci://quay.io/jetstack/charts/cert-manager -f values.yaml
DNS 레코드 구성
AWS에서 DNS를 관리하는 가장 좋은 방법은 Route53을 사용하는 것입니다. Route53 규칙을 수정할 수 있는 권한이 있는 AWS 계정을 만드세요.
EAB secret
자격 증명을 얻은 후 첫 단계는 secret으로 seed를 만드는 것입니다. 이는 ZeroSSL 계정으로 인증하는 역할을 합니다.
$ kubectl create secret generic \
zero-ssl-eabsecret \
--namespace=cert-manager \
--from-literal=secret='YOUR_ZEROSSL_EAB_HMAC_KEY'
secret을 만드는 또 다른 방법.
먼저 base64로 인코딩합니다.
echo -n "YOUR_ZEROSSL_EAB_HMAC_KEY" | base64 -w 0
apiVersion: v1
kind: Secret
metadata:
name: zero-ssl-eabsecret
data:
secret: YOUR_ENCODED_ZEROSSL_EAB_HMAC_KEY
kubectl apply -f zero-ssl-eabsecret.yaml -n cert-manager
Cluster issuer
그런 다음 ZeroSSL ClusterIssuer를 만들어야 합니다. 이름을 zerossl-production이라고 합시다. 우리의 경우 AWS를 사용합니다. 필요한 모든 요소를 프로비저닝하려면 사전 조건을 참조하세요.
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: zerossl-production
spec:
acme:
# ZeroSSL ACME server
server: https://acme.zerossl.com/v2/DV90
email: dummy-email@yopmail.com
# name of a secret used to store the ACME account private key
privateKeySecretRef:
name: zerossl-prod
# for each cert-manager new EAB credentials are required
externalAccountBinding:
keyID: YOUR_ZEROSSL_EAB_KEY_ID
keySecretRef:
name: zero-ssl-eabsecret
key: secret
keyAlgorithm: HS256
# ACME DNS-01 provider configurations to verify domain
solvers:
- selector: {}
dns01:
route53:
region: us-west-2
# optional if ambient credentials are available; see ambient credentials documentation
# see Route53 for >0 issue "letsencrypt.org" and change to >0 issue "sectigo.com"
accessKeyID: ACCESS_KEY_ID
secretAccessKeySecretRef:
name: route53-credentials-secret
key: secret-access-key
그런 다음 실행:
$ kubectl apply -n cert-manager -f zerossl-production.yaml
$ kubectl describe Clusterissuer zerossl-prod
Status:
Acme:
Last Registered Email: dummy-email@yopmail.com
Uri: https://acme.zerossl.com/v2/DV90/account/tXXX_NwSv15rlS_XXXX
Conditions:
Last Transition Time: 2021-09-09T17:03:26Z
Message: The ACME account was registered with the ACME server
Reason: ACMEAccountRegistered
Status: True
Type: Ready
참고하세요!
이 단계가 실패하고 ACME 계정이 등록되지 않은 경우 zero-ssl-eabsecret의 시크릿이 올바른지 확인하세요.
Ingress 인증서 요청
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-ingress
namespace: default
spec:
rules:
- host: test.example.com
tls:
- secretName: secret-tls
test-ingress를 적용합니다.
kubectl apply -f ingress.yaml
준비 완료입니다! Ingress를 확인하세요.
kubectl describe ingress test-ingress -n default
# check if tls is terminated using secret-tls
openssl s_client -showcerts -connect test.example.com:443
# verify server certificate and its chain