Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 2.36 KB

README.md

File metadata and controls

54 lines (34 loc) · 2.36 KB

Light-weight mixed-architecture cluster setup with k3s

installation (one-time actions)

k3s node installation

See k3s bootstrapping for details on creating the k3s cluster itself

Once a cluster is in-place, ensure that the $KUBECONFIG environment variable is set properly, or the target cluster is set in the ~/.kube/config file.

./bootstrap-cluster.sh

This script does several things:

  1. Installs flux2
  2. Bootstraps the vault-secret-operator with the auto-unwrap token
  3. Bootstraps cert-manager with letsencrypt information
  4. Bootstraps vault (see bootstrap-vault.sh for more detail)
    • Initializes vault if it has not already been initialized
    • Unseals vault
    • Configures vault to accept requests from vault-secrets-operator
    • Writes all secrets (held locally in the .env file) to vault for vault-secrets-operator to act on

cluster maintenance

After initial bootstrapping, it will be necessary to run scripts to apply manual changes that can't be natively handled via Flux. This is for yaml files that need envsubst prior to application to the cluster. This is also for updates to values stored in vault.

.env file

There are references to the .env file in the below scripts. This file is automatically sourced in order to populate secrets and sensitive information used in the scripts at runtime. This file is also prevented from commits via .gitignore.

A sample .env.sample file is provided as reference. To use this, cp .env.sample .env and make the necessary modifications for the secrets for your particular configuration.

objects

To apply necessary changes to kubernetes native objects, run bootstrap-objects.sh:

./bootstrap-objects.sh

vault updates

To apply new additions or updates to vault, run bootstrap-vault.sh:

./bootstrap-vault.sh

backup & restore

velero is used as the backup mechanism. However, as an alternative for situations where it is, unfortunately, necessary to backup & restore a persistent volume (e.g. completely removing a chart that leverages a persistent volume), the backup.sh and restore.sh scripts may be used. Examine to scripts to learn more.