|
| 1 | +.. _minio-certmanager: |
| 2 | + |
| 3 | +============ |
| 4 | +cert-manager |
| 5 | +============ |
| 6 | + |
| 7 | +.. default-domain:: minio |
| 8 | + |
| 9 | +.. contents:: Table of Contents |
| 10 | + :local: |
| 11 | + :depth: 1 |
| 12 | + |
| 13 | +TLS certificate management with cert-manager |
| 14 | +-------------------------------------------- |
| 15 | + |
| 16 | +This guide shows you how to install cert-manager for TLS certificate management. |
| 17 | +The guide assumes a new or fresh MinIO Operator installation. |
| 18 | + |
| 19 | +.. note:: |
| 20 | + |
| 21 | + This guide uses a self-signed ``Cluster Issuer``. |
| 22 | + You can also use `other Issuers supported by cert-manager <https://cert-manager.io/docs/configuration/issuers/>`__. |
| 23 | + |
| 24 | + The main difference is that you must provide that ``Issuer`` CA certificate to MinIO, instead of the CA's mentioned in this guide. |
| 25 | + |
| 26 | +Refer to the `cert-manager documentation <https://cert-manager.io>`__ and your own organization's certificate requirements for more advanced configurations. |
| 27 | + |
| 28 | +cert-manager manages certificates within Kubernetes clusters. |
| 29 | +The MinIO Operator supports using cert-manager for managing and provisioning certificates as an alternative to the MinIO Operator managing certificates for itself and its tenants. |
| 30 | + |
| 31 | +cert-manager obtains valid certificates from an ``Issuer`` or ``ClusterIssuer`` and can automatically renew certificates prior to expiration. |
| 32 | + |
| 33 | +A ``ClusterIssuer`` issues certificates for multiple namespaces. |
| 34 | +An ``Issuer`` only mints certificates for its own namespace. |
| 35 | + |
| 36 | +The following graphic depicts how cert-manager provides certificates in namespaces across a Kubernetes cluster. |
| 37 | + |
| 38 | +- A ``ClusterIssuer`` exists at the root level of the Kubernetes cluster, typically the ``default`` namespace, to provide certificates to all other namespaces. |
| 39 | +- The ``minio-operator`` namespace receives its own, local ``Issuer``. |
| 40 | +- Each tenant's namespace receives its own, local ``Issuer``. |
| 41 | +- The certificates issued by each tenant namespace must be made known to and trusted by the MinIO Operator. |
| 42 | + |
| 43 | +.. image:: /images/k8s/cert-manager-graph.png |
| 44 | + :width: 600px |
| 45 | + :alt: A graph of the namespaces in a Kubernetes cluster showing the relationship between the root level ClusterIssuer and three other namespaces with their own Issuer. |
| 46 | + :align: center |
| 47 | + |
| 48 | + |
| 49 | +Prerequisites |
| 50 | +------------- |
| 51 | + |
| 52 | +- A `supported version of Kubernetes <https://kubernetes.io/releases/>`__. |
| 53 | +- `kustomize <https://kustomize.io/>`__ installed |
| 54 | +- ``kubectl`` access to your ``k8s`` cluster |
| 55 | + |
| 56 | +.. _minio-setup-certmanager: |
| 57 | + |
| 58 | +Setup cert-manager |
| 59 | +------------------ |
| 60 | + |
| 61 | +Install cert-manager |
| 62 | +~~~~~~~~~~~~~~~~~~~~ |
| 63 | + |
| 64 | +The following command installs version 1.12.13 using ``kubectl``. |
| 65 | + |
| 66 | +.. code-block:: shell |
| 67 | + :class: copyable |
| 68 | + |
| 69 | + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.13/cert-manager.yaml |
| 70 | +
|
| 71 | +`Release 1.12.X LTS <https://cert-manager.io/docs/releases/release-notes/release-notes-1.12/>`__ is preferred, but you may install the latest version. |
| 72 | +For more details on installing cert-manager, see their `installation instructions <https://cert-manager.io/docs/installation/>`__. |
| 73 | + |
| 74 | +.. _minio-cert-manager-create-cluster-issuer: |
| 75 | + |
| 76 | +Create a self-signed Cluster Issuer for the cluster |
| 77 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 78 | + |
| 79 | +The ``Cluster Issuer`` is the top level Issuer from which all other certificates in the cluster derive. |
| 80 | + |
| 81 | +1. Request cert-manager to generate this by creating a ``ClusterIssuer`` resource. |
| 82 | + |
| 83 | + Create a file called ``selfsigned-root-clusterissuer.yaml`` with the following contents: |
| 84 | + |
| 85 | + .. code-block:: yaml |
| 86 | + :class: copyable |
| 87 | + |
| 88 | + # selfsigned-root-clusterissuer.yaml |
| 89 | + apiVersion: cert-manager.io/v1 |
| 90 | + kind: ClusterIssuer |
| 91 | + metadata: |
| 92 | + name: selfsigned-root |
| 93 | + spec: |
| 94 | + selfSigned: {} |
| 95 | +
|
| 96 | +2. Apply the resource to the cluster: |
| 97 | + |
| 98 | + .. code-block:: shell |
| 99 | + :class: copyable |
| 100 | +
|
| 101 | + kubectl apply -f selfsigned-root-clusterissuer.yaml |
| 102 | +
|
| 103 | +Next steps |
| 104 | +---------- |
| 105 | + |
| 106 | +Set up :ref:`cert-manager for the MinIO Operator <minio-certmanager-operator>`. |
| 107 | + |
| 108 | +.. toctree:: |
| 109 | + :titlesonly: |
| 110 | + :hidden: |
| 111 | + |
| 112 | + /operations/cert-manager/cert-manager-operator |
| 113 | + /operations/cert-manager/cert-manager-tenants |
0 commit comments