Skip to content

Commit

Permalink
helmify bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
OlleLarsson committed Nov 23, 2023
1 parent 6a6eebc commit 287fdeb
Show file tree
Hide file tree
Showing 23 changed files with 108 additions and 197 deletions.
53 changes: 0 additions & 53 deletions bin/bootstrap.bash

This file was deleted.

7 changes: 0 additions & 7 deletions bin/ck8s
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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] deploy the applications" 1>&2
echo " apply <wc|sc> [--sync] [--skip-template-validate] bootstrap and apps" 1>&2
echo " test <wc|sc> [--logging-enabled] test the applications" 1>&2
Expand Down Expand Up @@ -63,11 +62,6 @@ 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
Expand All @@ -76,7 +70,6 @@ case "${1}" in
apply)
[[ "${2}" =~ ^(wc|sc)$ ]] || usage
check_tools
"${here}/bootstrap.bash" "${2}"
"${here}/apps.bash" "${2}" "${SKIP}" "${SYNC}"
;;
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.

2 changes: 2 additions & 0 deletions helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ bases:
- helmfile/stacks/system.yaml
- helmfile/stacks/thanos.yaml
- helmfile/stacks/velero.yaml
- helmfile/stacks/namespaces.yaml
---
releases:
- inherit: [ template: ck8s-namespaces ]
- inherit: [ template: admin-rbac ]
- inherit: [ template: dev-rbac ]
- inherit: [ template: dev-rbac-crds ]
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions helmfile/stacks/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ templates:
- template: cert-manager-chart
name: cert-manager
needs:
- kube-system/ck8s-namespaces
- kube-system/common-np
values:
- helmfile/values/cert-manager.yaml.gotmpl
Expand Down
2 changes: 2 additions & 0 deletions helmfile/stacks/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ templates:
- template: podsecuritypolicies
labels:
psp: ingress-nginx
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/podsecuritypolicies/common/ingress-nginx.yaml.gotmpl

Expand Down
4 changes: 4 additions & 0 deletions helmfile/stacks/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ templates:
installed: {{ .Values | get "networkPolicies.monitoring.enabled" false }}
labels:
netpol: monitoring
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/networkpolicies/common/common.yaml.gotmpl
- helmfile/values/networkpolicies/common/prometheus.yaml.gotmpl
Expand All @@ -29,6 +31,8 @@ templates:
- template: podsecuritypolicies
labels:
psp: monitoring
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/podsecuritypolicies/common/monitoring.yaml.gotmpl

Expand Down
15 changes: 15 additions & 0 deletions helmfile/stacks/namespaces.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
templates:
ck8s-namespaces:
name: ck8s-namespaces
namespace: kube-system
labels:
app: ck8s-namespaces
chart: helmfile/charts/namespaces
version: 0.1.1
values:
{{ if .Values.ck8sManagementCluster.enabled }}
- helmfile/values/namespaces-sc.yaml.gotmpl
{{ else if .Values.ck8sWorkloadCluster.enabled }}
- helmfile/values/namespaces-wc.yaml.gotmpl
{{ end }}
6 changes: 6 additions & 0 deletions helmfile/stacks/thanos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ templates:
installed: {{ and (.Values | get "thanos.enabled" false) (.Values | get "networkPolicies.thanos.enabled" false) }}
labels:
netpol: thanos
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/networkpolicies/common/common.yaml.gotmpl
- helmfile/values/networkpolicies/service/thanos.yaml.gotmpl
Expand All @@ -31,6 +33,8 @@ templates:
app: prometheus
{{- end }}
name: thanos-ingress-secret
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/thanos/ingress-secret.yaml.gotmpl

Expand All @@ -40,6 +44,8 @@ templates:
- template: thanos-chart
installed: {{ .Values | get "thanos.enabled" false }}
name: thanos-objectstorage-secret
needs:
- kube-system/ck8s-namespaces
values:
- helmfile/values/thanos/objectstorage-secret.yaml.gotmpl

Expand Down
1 change: 1 addition & 0 deletions helmfile/stacks/velero.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ templates:
installed: {{ .Values | get "velero.enabled" false }}
name: velero
needs:
- kube-system/ck8s-namespaces
- monitoring/kube-prometheus-stack
- velero/podsecuritypolicy
values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ namespaces:
pod-security.kubernetes.io/warn: privileged
{{- end }}
- name: kube-node-lease
annotations:
helm.sh/resource-policy: keep
- name: kube-public
annotations:
helm.sh/resource-policy: keep
- name: kube-system
annotations:
helm.sh/resource-policy: keep
- name: monitoring
labels:
pod-security.kubernetes.io/audit: privileged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ namespaces:
pod-security.kubernetes.io/warn: privileged
{{- end }}
- name: kube-node-lease
annotations:
helm.sh/resource-policy: keep
- name: kube-public
annotations:
helm.sh/resource-policy: keep
- name: kube-system
annotations:
helm.sh/resource-policy: keep
- name: monitoring
labels:
pod-security.kubernetes.io/audit: privileged
Expand Down
6 changes: 6 additions & 0 deletions kind/cluster-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
8 changes: 0 additions & 8 deletions migration/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ As with all scripts in this repository `CK8S_CONFIG_PATH` is expected to be set.
export CK8S_CLUSTER=<wc|sc|both>
```

1. Rerun bootstrap:

```bash
./bin/ck8s bootstrap {sc|wc}
# or
./migration/${new_version}/apply/20-bootstrap.sh execute
```

1. Upgrade applications:

```bash
Expand Down
27 changes: 0 additions & 27 deletions migration/template/apply/20-bootstrap.sh

This file was deleted.

14 changes: 6 additions & 8 deletions migration/v0.34/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ As with all scripts in this repository `CK8S_CONFIG_PATH` is expected to be set.
./migration/v0.34/apply/12-hnc-crds.sh execute
```

1. Rerun bootstrap:

```bash
./bin/ck8s bootstrap {sc|wc}
# or
./migration/v0.34/apply/20-bootstrap.sh execute
```

1. Delete obsolete namespaces:

```bash
Expand All @@ -180,6 +172,12 @@ As with all scripts in this repository `CK8S_CONFIG_PATH` is expected to be set.
./migration/v0.34/apply/70-unmanage-user-alertmanager-secret.sh execute
```

1. Migrate ck8s-system namespaces to helm

```bash
./migration/v0.34/apply/ck8s-namespaces.sh
```

1. Upgrade applications:

```bash
Expand Down
28 changes: 0 additions & 28 deletions migration/v0.34/apply/20-bootstrap.sh

This file was deleted.

Loading

0 comments on commit 287fdeb

Please sign in to comment.