הפעלת cert-manager במרחב שמות בהתאמה אישית

במאמר הזה מוסבר איך מציינים מרחב שמות מותאם אישית של Kubernetes בשביל cert-manager.

ברוב המקרים, cert-manager פועל במרחב השמות cert-manager. יכול להיות שלחלק מהמשתמשים יש מדיניות חברה שמגבילה את היצירה של מרחבי שמות חדשים ב-Kubernetes, או מדיניות שמחייבת להפעיל את cert-manager במרחב שמות אחר, למשל kube-system.

ציון מרחב שמות מותאם אישית ל-cert-manager

  1. יוצרים את מרחב השמות אם צריך:
    kubectl create namespace new-cert-manager-namespace
  2. מתקינים את cert-manager לפי ההוראות במאמר Installation: Introduction (התקנה: מבוא) במסמכי התיעוד של cert-manager.
  3. מוסיפים בית certManager לקובץ ההגדרות.
    certManager:
      namespace: new-cert-manager-namespace
        
  4. מחילים את השינוי במרחב השמות:

    כדאי לבדוק קודם באמצעות הרצת בדיקה:

    helm upgrade operator apigee-operator/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --atomic \
      -f OVERRIDES_FILE.yaml \
      --dry-run=server
    

    מחילים את השינוי:

    helm upgrade operator apigee-operator/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --atomic \
      -f OVERRIDES_FILE.yaml
    
  5. מוודאים ש-cert-manager הותקן בצורה תקינה במרחב השמות החדש באמצעות הפקודה kubectl get pods:
    kubectl get pods -n new-cert-manager-namespace
    NAME                                      READY   STATUS    RESTARTS   AGE
    cert-manager-1234567-abcde                1/1     Running   0          21s
    cert-manager-cainjector-23456789a-bcdef   1/1     Running   0          22s
    cert-manager-webhook-3456789ab-cdef0      1/1     Running   0          20s
  6. אם מנהל האישורים פעל בעבר, צריך למחוק את מופע cert-manager במרחב השמות cert-manager לפי ההוראות שבקטע Uninstall in the cert-manager documentation (הסרה במסמכי התיעוד של מנהל האישורים).