Unable to Replace a Certificate for an S3 Data Service that was Deleted and Recreated with the Same Name

Problem Description

You are unable to retrieve the CSR, and thus to replace the certificate, for an S3 data service that was deleted and recreated with the same name.

Root Cause

Secrets used for certificate management are not automatically deleted when a service is removed, since they may still be in use or required for security. If the service is recreated with the same name, the existing secret prevents a new CSR from being generated.

Problem Resolution

  1. Identify the secret associated with the S3 endpoint.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf get secrets -n zenko | grep "kubernetes.io/tls"
    
  2. Delete the secret matching your certificate. Replace <secret-name> with the name of the secret you identified in the previous step.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf delete secret  -n zenko <secret-name>