You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/management/kubectl-apply/README.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ This module simplifies the following functionality:
15
15
* A single URL to a manifest file. Ex.: `https://github.com/.../myrepo/manifest.yaml`.
16
16
17
17
> **Note:** Applying from a URL has important limitations. Please review the [Considerations & Callouts for Applying from URLs](#applying-manifests-from-urls-considerations--callouts) section below.
18
-
* A single local YAML manifest file (`.yaml`). Ex.: `./manifest.yaml`.
18
+
* A single local YAML manifest file (`.yaml` or `.yml`). Ex.: `./manifest.yaml`.
19
19
* A template file (`.tftpl`) to generate a manifest. Ex.: `./template.yaml.tftpl`. You can pass the variables to format the template file in `template_vars`.
20
-
* A directory containing multiple YAML or template files. Ex: `./manifests/`. You can pass the variables to format the template files in `template_vars`.
20
+
* A directory containing multiple YAML or template files. Ex: `./manifests/` or `./manifests`. The module correctly identifies directories even if the trailing slash is omitted. For security and stability, the module only processes files with `.yaml`, `.yml`, or `.tftpl` extensions. Other files in the directory (like `README.md` etc. ) are automatically ignored.
21
21
22
22
#### Manifest Example
23
23
@@ -115,6 +115,17 @@ The `path` field accepts a template file. You will need to provide variables for
115
115
116
116
## Callouts
117
117
118
+
### Helm-based Manifest Application
119
+
120
+
#### 1. Large Manifests and CRDs
121
+
Helm stores the entire release state (including the generated manifests) as a standard Kubernetes Secret in the release namespace. Before storing the state, Helm runs the YAML through [GZIP compression and base64 encoding](https://helm.sh/docs/topics/kubernetes_apis/#:~:text=The%20manifest%20is,of%20the%20release.). This effectively raises the limit to ~1MB or more, allowing for the deployment of very large manifests and complex CRDs without requiring Server-Side Apply (SSA). This behaviour is guaranteed because the [Terraform Helm Provider](https://github.com/hashicorp/terraform-provider-helm) directly imports the official [Helm Go SDK](https://github.com/helm/helm/tree/main/pkg/action).
122
+
123
+
#### 2. Release Suffixes
124
+
The module introduces a `random_id` to generate a unique 4-byte suffix for each Helm release (e.g., `manifest-apply-ceab0dfc-0`). This prevents name collisions when multiple module instances (e.g., `gke-cluster` and `gke-node-pool`) instantiate the `kubectl-apply` source simultaneously within the same blueprint. This ID is stored in the Terraform state, ensuring the release name remains stable across re-deployments.
125
+
126
+
#### 3. Re-deployment Conflicts
127
+
If a deployment fails, the `atomic = true` setting ensures that Helm automatically rolls back the release, preventing the cluster from being left in a "half-applied" state. If you encounter persistent conflicts during re-deployment due to immutable fields, you may need to manually delete the resource or the Helm release before re-applying.
128
+
118
129
### Applying Manifests from URLs: Considerations & Callouts
119
130
120
131
While this module supports applying manifests directly from remote `http://` or `https://` URLs, this method introduces complexities not present when using local files. For production environments, we recommend sourcing manifests from local paths or a version-controlled Git repository. Moreover, this method will be deprecated soon. Hence we recommend to use other methods to source manifests.
@@ -142,7 +153,6 @@ To ensure a reliable deployment, you must manually enforce the correct order of
- source: "https://gist.githubusercontent.com/YourUser/..." # Your configuration URL
163
-
server_side_apply: true
164
172
```
165
173
166
174
4. **Run the deployment command again.** Since the CRDs are now guaranteed to exist in the cluster, this second apply will succeed reliably.
167
175
168
-
#### **2. Large Manifests (CRDs)**
169
-
170
-
* **Issue:** Applying very large manifests can fail with a `metadata.annotations: Too long` error.
171
-
* **Solution:** Enable Server-Side Apply by setting `server_side_apply: true` for the manifest entry.
172
-
173
-
#### **3. Conflicts on Re-application**
174
-
175
-
* **Issue:** Re-running a deployment after a partial failure can cause server-side apply field manager `conflicts`.
176
-
* **Solution:** Forcibly take ownership of the resource fields by setting `force_conflicts: true`.
177
-
178
-
#### **4. Terraform Template Files (`.tftpl`)**
176
+
#### **2. Terraform Template Files (`.tftpl`)**
179
177
180
178
* **Limitation:** This module **cannot** render a template file (`.tftpl`) when sourced from a remote URL.
181
179
* **Workaround:** You must render the template into a pure YAML file locally, host that rendered file at a URL, and provide the URL of the rendered file in your blueprint.
@@ -206,13 +204,15 @@ limitations under the License.
| <a name="input_apply_manifests"></a> [apply\_manifests](#input\_apply\_manifests) | A list of manifests to apply to GKE cluster using kubectl. For more details see [kubectl module's inputs](kubectl/README.md).<br/> NOTE: The `enable` input acts as a FF to apply a manifest or not. By default it is always set to `true`. | <pre>list(object({<br/> enable = optional(bool, true)<br/> content = optional(string, null)<br/> source = optional(string, null)<br/> template_vars = optional(map(any), null)<br/> server_side_apply = optional(bool, false)<br/> wait_for_rollout = optional(bool, true)<br/> }))</pre> | `[]` | no |
248
+
| <a name="input_apply_manifests"></a> [apply\_manifests](#input\_apply\_manifests) | A list of manifests to apply to the GKE cluster using helm\_install. For more details on the underlying deployment mechanism, see the [helm\_install module](helm\_install/README.md).The `enable` input acts as a FF to apply a manifest or not. By default it is always set to `true`. | <pre>list(object({<br/> enable = optional(bool, true)<br/> content = optional(string, null)<br/> source = optional(string, null)<br/> template_vars = optional(map(any), null)<br/> wait_for_rollout = optional(bool, true)<br/> namespace = optional(string, null)<br/> }))</pre> | `[]` | no |
248
249
| <a name="input_asapd_lite"></a> [asapd\_lite](#input\_asapd\_lite) | Install the asapd-lite daemonset for A4X-Max Bare Metal. | <pre>object({<br/> install = bool<br/> config_path = string<br/> })</pre> | <pre>{<br/> "config_path": "",<br/> "install": false<br/>}</pre> | no |
249
250
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | An identifier for the gke cluster resource with format projects/<project\_id>/locations/<region>/clusters/<name>. | `string` | n/a | yes |
Copy file name to clipboardExpand all lines: modules/management/kubectl-apply/helm_install/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ No modules.
43
43
| <aname="input_keyring"></a> [keyring](#input\_keyring)| Location of public keys used for verification ('helm install --keyring'). Used if 'verify' is true. |`string`|`null`| no |
44
44
| <aname="input_lint"></a> [lint](#input\_lint)| Run the helm chart linter during the plan ('helm lint'). |`bool`|`false`| no |
45
45
| <aname="input_max_history"></a> [max\_history](#input\_max\_history)| Limit the maximum number of revisions saved per release ('helm upgrade --history-max'). 0 for no limit. |`number`|`null`| no |
46
-
| <aname="input_namespace"></a> [namespace](#input\_namespace)| Kubernetes namespace to install the Helm release into. |`string`|`"default"`| no |
46
+
| <aname="input_namespace"></a> [namespace](#input\_namespace)| Kubernetes namespace to install the Helm release into. |`string`|`null`| no |
47
47
| <aname="input_pass_credentials"></a> [pass\_credentials](#input\_pass\_credentials)| Pass credentials to all domains ('helm install --pass-credentials'). Use with caution. |`bool`|`false`| no |
48
48
| <aname="input_postrender"></a> [postrender](#input\_postrender)| Configuration for a post-rendering executable ('helm install --post-renderer'). Should be an object with 'binary\_path' attribute. | <pre>object({<br/> binary_path = string # Path to the post-renderer executable<br/> })</pre> |`null`| no |
49
49
| <aname="input_recreate_pods"></a> [recreate\_pods](#input\_recreate\_pods)| Perform pods restart for the resource if applicable ('helm upgrade --recreate-pods'). Note: This flag is deprecated in Helm CLI v3 itself. |`bool`|`false`| no |
0 commit comments