Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bootstrapping of namespaces by integrating them into the helmfile workflow #1881

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ The configuration contains some `set-me`'s that must be configured manually.
> [!important]
> Setting up ingresses properly requires some additional steps documented later in this section.
> [!important]
> Namespaces are not yet managed by `helmfile` so you must first run `./bin/ck8s bootstrap sc|wc`.
Manage apps by using `helmfile` directly and with needs it will pull in all required releases:

```sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Run the script to see what options are available.
#### Examples
- Bootstrap and deploy apps to the workload cluster:
- Deploy apps to the workload cluster:
```bash
./bin/ck8s apply wc
Expand Down
3 changes: 1 addition & 2 deletions bin/apps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ apps_sc() {
#
# The first few Charts install CRDs, which will make template validation
# fail. CRDs are "changes" to the Kubernetes API, hence validation against
# the Kubernetes API cannot be done. OTOH, manually adding the CRDs during
# bootstrap is error-prone and adds maintenance burden.
# the Kubernetes API cannot be done.
#
# While it would be nice to have some template validation before `helmfile apply`,
# at least Helmfile does "just in time" template validation. Not as nice,
Expand Down
53 changes: 0 additions & 53 deletions bin/bootstrap.bash

This file was deleted.

15 changes: 1 addition & 14 deletions bin/ck8s
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ source "${here}/common.bash"
usage() {
echo "COMMANDS:" 1>&2
echo " init <wc|sc|both> [--generate-new-secrets] initialize the config path" 1>&2
echo " bootstrap <wc|sc> bootstrap the cluster" 1>&2
echo " apps <wc|sc> [--sync] [--skip-template-validate] [--concurrency=<num>] deploy the applications" 1>&2
echo " apply <wc|sc> [--sync] [--skip-template-validate] [--concurrency=<num>] bootstrap and apps" 1>&2
echo " apply <wc|sc> [--sync] [--skip-template-validate] [--concurrency=<num>] deploy the apps" 1>&2
echo " test <wc|sc> [--logging-enabled] test the applications" 1>&2
echo " dry-run <wc|sc> [--kubectl] runs helmfile diff" 1>&2
echo " fix-psp-violations <wc|sc> Checks and restarts pods that violates Pod Security Polices, applicable for new environments" 1>&2
Expand Down Expand Up @@ -65,20 +63,9 @@ case "${1}" in
export CK8S_CLUSTER="${2}"
"${here}/init.bash" "${GEN_NEW_SECRETS}"
;;
bootstrap)
[[ "${2}" =~ ^(wc|sc)$ ]] || usage
check_tools
"${here}/bootstrap.bash" "${2}"
;;
apps)
[[ "${2}" =~ ^(wc|sc)$ ]] || usage
check_tools
"${here}/apps.bash" "${2}" "${SKIP}" "${SYNC}" "${CONCURRENCY}"
;;
apply)
[[ "${2}" =~ ^(wc|sc)$ ]] || usage
check_tools
"${here}/bootstrap.bash" "${2}"
"${here}/apps.bash" "${2}" "${SKIP}" "${SYNC}" "${CONCURRENCY}"
;;
test)
Expand Down
11 changes: 0 additions & 11 deletions bootstrap/bootstrap.sh

This file was deleted.

12 changes: 0 additions & 12 deletions bootstrap/namespaces/bootstrap.sh

This file was deleted.

43 changes: 0 additions & 43 deletions bootstrap/namespaces/helmfile/helmfile.yaml

This file was deleted.

77 changes: 0 additions & 77 deletions bootstrap/namespaces/helmfile/values/namespaces-sc.yaml.gotmpl

This file was deleted.

73 changes: 0 additions & 73 deletions bootstrap/namespaces/helmfile/values/namespaces-wc.yaml.gotmpl

This file was deleted.

16 changes: 0 additions & 16 deletions completion/bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

_ck8s_command_ck8s() {
opts+=("init")
opts+=("bootstrap")
opts+=("apps")
opts+=("apply")
opts+=("test")
opts+=("dry-run")
Expand All @@ -18,20 +16,6 @@ _ck8s_command_ck8s() {
COMPREPLY=($(compgen -W "${opts[*]}" -- ${cur}))
}

_ck8s_command_ck8s_bootstrap() {
local opts=()
opts+=("sc")
opts+=("wc")
COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
}

_ck8s_command_ck8s_apps() {
local opts=()
opts+=("sc")
opts+=("wc")
COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
}

_ck8s_command_ck8s_apply() {
local opts=()
opts+=("sc")
Expand Down
4 changes: 4 additions & 0 deletions helmfile.d/stacks/falco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ templates:
installed: {{ and (.Values | get "falco.enabled" false) (.Values | get "networkPolicies.falco.enabled" false) }}
labels:
netpol: falco
needs:
- kube-system/admin-namespaces
values:
- values/networkpolicies/common/common.yaml.gotmpl
- values/networkpolicies/common/falco.yaml.gotmpl
Expand All @@ -23,6 +25,8 @@ templates:
- template: podsecuritypolicies
labels:
psp: falco
needs:
- kube-system/admin-namespaces
values:
- values/podsecuritypolicies/common/falco.yaml.gotmpl

Expand Down
2 changes: 2 additions & 0 deletions helmfile.d/stacks/harbor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ templates:
installed: {{ and (.Values | get "harbor.enabled" false) (.Values | get "networkPolicies.harbor.enabled" false) }}
labels:
netpol: harbor
needs:
- kube-system/admin-namespaces
values:
- values/networkpolicies/common/common.yaml.gotmpl
- values/networkpolicies/service/harbor.yaml.gotmpl
Expand Down
Loading