Tài liệu › Kho chứng chỉ (nơi cài)

Kubernetes

Agent ghi Secret kiểu kubernetes.io/tls trong một namespace; Ingress hoặc Gateway đọc Secret đó.

Khai báo kho

TrườngGhi chú
API serverhttps://k8s.congty.local:6443 (phải trong allowed_hosts của agent)
Xác thựcToken của ServiceAccount, hoặc kubeconfig trên máy chạy agent
CA của API serverFile CA hoặc nội dung PEM

Nơi cài

TrườngGhi chú
Namespaceweb
Tên SecretĐể trống: <tên chứng chỉ>-tls

Agent tạo/cập nhật Secret kubernetes.io/tls (tls.crt gồm chuỗi, tls.key) và ghi annotation certman.mettacert.com/updated. Ingress controller (nginx, Traefik, HAProxy) tự tải lại khi Secret đổi.

RBAC tối thiểu

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: { name: certman-agent, namespace: web }
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "list", "create", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: { name: certman-agent, namespace: web }
subjects: [{ kind: ServiceAccount, name: certman-agent, namespace: web }]
roleRef: { kind: Role, name: certman-agent, apiGroup: rbac.authorization.k8s.io }

Dùng Role trong đúng namespace, không dùng ClusterRole. Cluster đã có cert-manager thì vẫn có thể dùng Metta cho chứng chỉ thương mại/CA nội bộ mà cert-manager không hỗ trợ.

Cập nhật 10/10/2026Bài này có hữu ích?