cert-manager for Tenants
The following procedures create and apply the resources necessary to use cert-manager for the TLS certificates within a tenant.
Note
The procedures use tenant-1 as the name of the tenant.
Replace the string tenant-1 throughout the procedures to reflect the name of your tenant.
Prerequisites
- kustomize installed
kubectlaccess to yourk8scluster- Completed the steps to set up cert-manager
- The MinIO Operator installed and set up for cert-manager.
1) Create the tenant namespace CA Issuer
Before deploying a new tenant, create a Certificate Authority and Issuer for the tenant’s namespace.
-
If necessary, create the tenant’s namespace.
This much match the value of the
metadata.namespacefield in the tenant’s YAML. -
Request a Certificate for a new Certificate Authority with
spec.isCAset totrue.Create a file called
tenant-1-ca-certificate.yamlwith the following contents:WarningImportant
The
spec.issueRef.namemust match the name of theClusterIssuercreated when setting up cert-manager. If you specified a differentClusterIssuername or are using a differentIssuerfrom the guide, modify theissuerRefto match your environment. -
Apply the resource:
2) Create the Issuer
The Issuer issues the certificates within the tenant namespace.
-
Generate a resource definition for an
Issuer.Create a file called
tenant-1-ca-issuer.yamlwith the following contents: -
Apply the
Issuerresource definition:
3) Create a certificate for the tenant
Request that cert-manager issue a new TLS server certificate for MinIO. The certificate must be valid for the following DNS domains:
minio.<namespace>minio.<namespace>.svcminio.<namespace>.svc.<cluster domain>*.<tenant-name>-hl.<namespace>.svc.<cluster domain>*.<namespace>.svc.<cluster domain>*.<tenant-name>.minio.<namespace>.svc.<cluster domain>'
Important
Replace the placeholder text (marked with the < and > characters) with values for your tenant:
-
<cluster domain>is the internal root DNS domain assigned in your Kubernetes cluster. Typically, this iscluster.local, but confirm the value by checking your CoreDNS configuration for the correct value for your Kubernetes cluster.For example:
Different Kubernetes providers manage the root domain differently. Check with your Kubernetes provider for more information.
-
tenant-nameis the name provided to your tenant in themetadata.nameof the Tenant YAML. For this example it ismyminio. -
namespaceis the value created earlier where the tenant will be installed. In the tenant YAML, it is defined in themetadata.namespacefield. For this example it istenant-1.
-
Request a
Certificatefor the specified domainsCreate a file called
tenant-1-minio-certificate.yaml. The contents of the file should resemble the following, modified to reflect your cluster and tenant configurations:NoteTip
For this example, the Tenant name is
myminio. We recommend naming the secret in the fieldspec.secretNameas<tenant-name>-tlsas a naming convention. -
Apply the certificate resource:
-
Validate the changes took effect:
NoteNote
- Replace
tenant-1with the namespace for your tenant. - Replace
myminio-tlswith the name of your secret, if different.
- Replace
4) Deploy the tenant using cert-manager for TLS certificate management
When deploying a Tenant, you must set the TLS configuration such that:
- The Tenant does not automatically generate its own certificates (
spec.requestAutoCert: false) and - The Tenant has a valid cert-manager reference (
spec.externalCertSecret)
This directs the Operator to deploy the Tenant using the cert-manager certificates exclusively.
The following YAML spec provides a baseline configuration meeting these requirements:
5) Trust the tenant’s CA in MinIO Operator
The MinIO Operator does not trust the tenant’s CA by default. To trust the tenant’s CA, you must pass the certificate to the Operator as a secret.
To do this, create a secret with the prefix operator-ca-tls- followed by a unique identifier in the minio-operator namespace.
MinIO Operator mounts and trusts all certificates issued by the provided Certificate Authorities. This is required because the MinIO Operator performs health checks using the /minio/health/cluster endpoint.
Create operator-ca-tls-tenant-1 secret
Copy the tenant’s cert-manager generated CA public key (ca.crt) into the minio-operator namespace. This allows Operator to trust the cert-manager issued CA and all certificates derived from it.
-
Create a
ca.crtfile containing the CA: -
Create the secret:
Tip
In this example we chose a secret name of operator-ca-tls-tenant-1. We used the tenant namespace tenant-1 as a suffix for easy identification of which namespace the CA comes from. Use the name of your tenant namespace for easier linking secrets to the related resources.
6) Deploy the tenant
With the Certificate Authority and Issuer in place for the tenant’s namespace, you can now deploy the object store tenant.
Use the modified baseline tenant YAML to disable AutoCert and reference the secret you generated.