|
| 1 | +# Cert Manager Module Guide |
| 2 | + |
| 3 | +# TODO: Convert from Kargo to generalized Konductor Framework Template repo docs content |
| 4 | + |
| 5 | +Welcome to the **Cert Manager Module** for the Konductor IaC Framework! This guide is tailored for both newcomers to DevOps and experienced developers, providing a comprehensive overview of how to deploy and configure the Cert Manager module within the Kargo platform. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +- [Introduction](#introduction) |
| 12 | +- [Why Use Cert Manager?](#why-use-cert-manager) |
| 13 | +- [Getting Started](#getting-started) |
| 14 | +- [Enabling the Module](#enabling-the-module) |
| 15 | +- [Configuration Options](#configuration-options) |
| 16 | + - [Default Settings](#default-settings) |
| 17 | + - [Customizing Your Deployment](#customizing-your-deployment) |
| 18 | + |
| 19 | +- [Module Components Explained](#module-components-explained) |
| 20 | + - [Namespace Creation](#namespace-creation) |
| 21 | + - [Helm Chart Deployment](#helm-chart-deployment) |
| 22 | + - [Self-Signed Cluster Issuer Setup](#self-signed-cluster-issuer-setup) |
| 23 | + |
| 24 | +- [Using the Module](#using-the-module) |
| 25 | + - [Example Usage](#example-usage) |
| 26 | + |
| 27 | +- [Troubleshooting and FAQs](#troubleshooting-and-faqs) |
| 28 | +- [Additional Resources](#additional-resources) |
| 29 | +- [Conclusion](#conclusion) |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Introduction |
| 34 | + |
| 35 | +The Cert Manager module automates the management of SSL/TLS certificates in your Kubernetes cluster using [cert-manager](https://cert-manager.io/). It simplifies the process of obtaining, renewing, and managing certificates, enhancing the security of your applications without manual intervention. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## Why Use Cert Manager? |
| 40 | + |
| 41 | +- **Automation**: Automatically provisions and renews certificates. |
| 42 | +- **Integration**: Works seamlessly with Kubernetes Ingress resources and other services. |
| 43 | +- **Security**: Enhances security by ensuring certificates are always up-to-date. |
| 44 | +- **Compliance**: Helps meet compliance requirements by managing PKI effectively. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Getting Started |
| 49 | + |
| 50 | +### Prerequisites |
| 51 | + |
| 52 | +- **Kubernetes Cluster**: Ensure you have access to a Kubernetes cluster. |
| 53 | +- **Pulumi CLI**: Install the Pulumi CLI and configure it. |
| 54 | +- **Kubeconfig**: Your kubeconfig file should be properly set up. |
| 55 | + |
| 56 | +### Setup Steps |
| 57 | + |
| 58 | +1. **Navigate to the Kargo Pulumi Directory**: |
| 59 | + |
| 60 | +```bash |
| 61 | +cd Kargo/pulumi |
| 62 | +``` |
| 63 | + |
| 64 | +2. **Install Dependencies**: |
| 65 | + |
| 66 | +```bash |
| 67 | +pip install -r requirements.txt |
| 68 | +``` |
| 69 | + |
| 70 | +3. **Initialize Pulumi Stack**: |
| 71 | + |
| 72 | +```bash |
| 73 | +pulumi stack init dev |
| 74 | +``` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Enabling the Module |
| 79 | + |
| 80 | +The Cert Manager module is enabled by default. To verify or modify its enabled status, adjust your Pulumi configuration. |
| 81 | + |
| 82 | +### Verifying Module Enablement |
| 83 | + |
| 84 | +```yaml |
| 85 | +# Pulumi.<stack-name>.yaml |
| 86 | + |
| 87 | +config: |
| 88 | + cert_manager: |
| 89 | + enabled: true # Set to false to disable |
| 90 | +``` |
| 91 | +
|
| 92 | +Alternatively, use the Pulumi CLI: |
| 93 | +
|
| 94 | +```bash |
| 95 | +pulumi config set --path cert_manager.enabled true |
| 96 | +``` |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Configuration Options |
| 101 | + |
| 102 | +### Default Settings |
| 103 | + |
| 104 | +The module is designed to work out-of-the-box with default settings: |
| 105 | + |
| 106 | +- **Namespace**: `cert-manager` |
| 107 | +- __Version__: Defined in `default_versions.json` |
| 108 | +- **Cluster Issuer Name**: `cluster-selfsigned-issuer` |
| 109 | +- **Install CRDs**: `true` |
| 110 | + |
| 111 | +### Customizing Your Deployment |
| 112 | + |
| 113 | +You can tailor the module to fit your specific needs by customizing its configuration. |
| 114 | + |
| 115 | +#### Available Configuration Parameters |
| 116 | + |
| 117 | +- **enabled** *(bool)*: Enable or disable the module. |
| 118 | +- **namespace** *(string)*: Kubernetes namespace for cert-manager. |
| 119 | +- **version** *(string)*: Helm chart version to deploy. Use `'latest'` to fetch the most recent stable version. |
| 120 | +- __cluster_issuer__ _(string)_: Name of the ClusterIssuer resource. |
| 121 | +- __install_crds__ _(bool)_: Whether to install Custom Resource Definitions. |
| 122 | + |
| 123 | +#### Example Custom Configuration |
| 124 | + |
| 125 | +```yaml |
| 126 | +config: |
| 127 | + cert_manager: |
| 128 | + enabled: true |
| 129 | + namespace: "my-cert-manager" |
| 130 | + version: "1.15.3" |
| 131 | + cluster_issuer: "my-cluster-issuer" |
| 132 | + install_crds: true |
| 133 | +``` |
| 134 | +
|
| 135 | +--- |
| 136 | +
|
| 137 | +## Module Components Explained |
| 138 | +
|
| 139 | +### Namespace Creation |
| 140 | +
|
| 141 | +A dedicated namespace is created to isolate cert-manager resources. |
| 142 | +
|
| 143 | +- **Why?**: Ensures better organization and avoids conflicts. |
| 144 | +- **Customizable**: Change the namespace using the `namespace` parameter. |
| 145 | + |
| 146 | +### Helm Chart Deployment |
| 147 | + |
| 148 | +Deploys cert-manager using Helm. |
| 149 | + |
| 150 | +- **Chart Repository**: `https://charts.jetstack.io` |
| 151 | +- **Version Management**: Specify a version or use `'latest'`. |
| 152 | +- **Custom Values**: Resource requests and limits are set for optimal performance. |
| 153 | + |
| 154 | +### Self-Signed Cluster Issuer Setup |
| 155 | + |
| 156 | +Sets up a self-signed ClusterIssuer for certificate provisioning. |
| 157 | + |
| 158 | +- **Root ClusterIssuer**: Creates a root issuer. |
| 159 | +- **CA Certificate**: Generates a CA certificate stored in a Kubernetes Secret. |
| 160 | +- **Primary ClusterIssuer**: Issues certificates for your applications using the CA certificate. |
| 161 | +- **Exported Values**: CA certificate data is exported for use in other modules. |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +## Using the Module |
| 166 | + |
| 167 | +### Example Usage |
| 168 | + |
| 169 | +After enabling and configuring the module, deploy it using Pulumi: |
| 170 | + |
| 171 | +```bash |
| 172 | +pulumi up |
| 173 | +``` |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +## Troubleshooting and FAQs |
| 178 | + |
| 179 | +**Q1: Cert-manager pods are not running.** |
| 180 | + |
| 181 | +- **A**: Check the namespace and ensure that CRDs are installed. Verify the Kubernetes version compatibility. |
| 182 | + |
| 183 | +**Q2: Certificates are not being issued.** |
| 184 | + |
| 185 | +- **A**: Ensure that the ClusterIssuer is correctly configured and that your Ingress resources reference it. |
| 186 | + |
| 187 | +**Q3: How do I update cert-manager to a newer version?** |
| 188 | + |
| 189 | +- **A**: Update the `version` parameter in your configuration and run `pulumi up`. |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## Additional Resources |
| 194 | + |
| 195 | +- **cert-manager Documentation**: [cert-manager.io/docs](https://cert-manager.io/docs/) |
| 196 | +- **Kargo Project**: [Kargo GitHub Repository](https://github.com/ContainerCraft/Kargo) |
| 197 | +- **Pulumi Kubernetes Provider**: [Pulumi Kubernetes Docs](https://www.pulumi.com/docs/reference/pkg/kubernetes/) |
| 198 | +- **Helm Charts Repository**: [Artifact Hub - cert-manager](https://artifacthub.io/packages/helm/cert-manager/cert-manager) |
0 commit comments