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: README.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -334,11 +334,40 @@ _That said, you can also use pure Terraform and import the kube-hetzner module a
334
334
335
335
<details>
336
336
337
-
<summary>Custom post-install actions</summary>
337
+
<summary>Custom pre- and post-install actions</summary>
338
338
339
339
After the initial bootstrapping of your Kubernetes cluster, you might want to deploy applications using the same terraform mechanism. For many scenarios it is sufficient to create a `kustomization.yaml.tpl` file (see [Adding Extras](#adding-extras)). All applied kustomizations will be applied at once by executing a single `kubectl apply -k` command.
340
340
341
-
However, some applications that e.g. provide custom CRDs (e.g. [ArgoCD](https://argoproj.github.io/cd/)) need a different deployment strategy: one has to deploy CRDs first, then wait for the deployment, before being able to install the actual application. In the ArgoCD case, not waiting for the CRD setup to finish will cause failures. Therefore, an additional mechanism is available to support these kind of deployments. Specify `extra_kustomize_deployment_commands` in your `kube.tf` file containing a series of commands to be executed, after the `Kustomization` step finished:
341
+
However, some applications that e.g. provide custom CRDs (e.g. [ArgoCD](https://argoproj.github.io/cd/)) need a different deployment strategy: one has to deploy CRDs first, then wait for the deployment, before being able to install the actual application. In the ArgoCD case, not waiting for the CRD setup to finish will cause failures. Therefore, an additional mechanism is available to support these kind of deployments.
342
+
343
+
### Pre-install Actions, Example: external-secrets repo and Helm
344
+
You can install Helm repos and CRDs before the main Kustomization scripts by adding the helm charts to the `extra-manifests-preinstall` folder and specifying the Helm chart in `extra-manifests-preinstall/kustomization.yaml.tpl`, just like with `extra-manifests`.
345
+
346
+
For example, to add `external-secrets` so that it can be referenced later on, create files:
Specify `extra_kustomize_deployment_commands` in your `kube.tf` file containing a series of commands to be executed, after the `Kustomization` step has finished:
Copy file name to clipboardExpand all lines: kube.tf.example
+26-1Lines changed: 26 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -955,9 +955,34 @@ module "kube-hetzner" {
955
955
# Extra commands to be executed after the `kubectl apply -k` (useful for post-install actions, e.g. wait for CRD, apply additional manifests, etc.).
956
956
# extra_kustomize_deployment_commands=""
957
957
958
-
# Extra values that will be passed to the `extra-manifests/kustomization.yaml.tpl` if its present.
958
+
# Extra values that will be passed to the `extra-manifests/kustomization.yaml.tpl` and `extra-manifests-preinstall/kustomization.yaml.tpl` when present.
959
959
# extra_kustomize_parameters={}
960
960
961
+
# You can add extra kustomizations to be deployed in sequence by setting the `user_kustomizations` variable.
962
+
# This will override the use of `extra_kustomize_deployment_commands` and `extra_kustomize_parameters` for extra-manifests, hence they will need to be reset, see below.
963
+
#
964
+
# The Kustomization "sets" are run in sequential order (by numeric key) so that you can for example install a CRD and wait for it to be deployed.
965
+
#
966
+
# source_folder: Sets the source folder for *.yaml.tpl and Kustomization.yaml.tpl
967
+
# kustomize_parameters: Key-value map for passing variables into Kustomization. Applies only to the Kustomization-set in the object, but to all files defined in the source_folder of the "set".
968
+
# post_commands: Commands to be executed after applying the Kustomization ("kubectl apply -k"). You can use it to wait for CRD deployment etc.
969
+
# - An example to wait for deployments in all namespaces: `kubectl wait --for=condition=Available deployment --all -A --timeout=120s || exit 0` (The `|| exit 0` is not "required", it just makes the deployment to continue even if a deployment hasn't started up properly)
970
+
# - You can pass full bash-compatible scripts into the `post_commands`-variable with EOT
971
+
#
972
+
# An example from the default values: (uncomment or copy your own)
# kustomize_parameters = var.extra_kustomize_parameters # Same as `extra_kustomize_parameters` in kube.tf, replace with actual values if uncommenting
982
+
# post_commands = var.extra_kustomize_deployment_commands # Same as `extra_kustomize_deployment_commands` in kube.tf, replace with actual values if uncommenting
983
+
# }
984
+
# }
985
+
961
986
# See working examples for extra manifests or a HelmChart in examples/kustomization_user_deploy/README.md
962
987
963
988
# It is best practice to turn this off, but for backwards compatibility it is set to "true" by default.
0 commit comments