Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
5a5f1fd
chore: use cloudnative.coop
BobyMCbobs Mar 12, 2024
7f35944
chore: use standard cluster folder name
BobyMCbobs Mar 12, 2024
0bb99e7
chore: update default repo org
BobyMCbobs Mar 12, 2024
43c56ce
chore: depend webhoook on flux bootstrap
BobyMCbobs Mar 12, 2024
e24ca18
chore: update destroy command
BobyMCbobs Mar 12, 2024
b6d49fc
chore: add empty kubeconfig in tmp to move along
BobyMCbobs Mar 12, 2024
1aced87
Add Flux sync manifests
Mar 12, 2024
fd3f67a
chore: update powerdns postgres config
BobyMCbobs Mar 12, 2024
2da11e2
chore: add depends for talos apply
BobyMCbobs Mar 12, 2024
4058669
chore: make overrides optional
BobyMCbobs Mar 12, 2024
480e749
chore: add longhorn postbuild
BobyMCbobs Mar 12, 2024
a8925a1
chore: update pdns secrets
BobyMCbobs Mar 12, 2024
9db64d2
chore: add some more locals
BobyMCbobs Mar 12, 2024
f056cb0
chore: use specific dns01 recursive nameservers
BobyMCbobs Mar 12, 2024
9d5866d
Uninstall Flux
Mar 13, 2024
fbd7a10
chore: update domain for pdns
BobyMCbobs Mar 13, 2024
f68dca4
Add Flux v2.2.3 component manifests
Mar 13, 2024
7cdacaf
Add Flux sync manifests
Mar 13, 2024
9611e41
chore: restart pods on change of config
hh Mar 13, 2024
1e30ab7
feat: add KubeVirt Operator
BobyMCbobs Mar 13, 2024
42788f8
fix: typo for KubeVirt Operator url
BobyMCbobs Mar 13, 2024
1b06d38
chore: use kubevirt-operator kustomization
BobyMCbobs Mar 13, 2024
107f2e6
feat: add KubeVirt instance
BobyMCbobs Mar 13, 2024
cf6b1e8
chore: enable kubevirt
BobyMCbobs Mar 13, 2024
3c37a7b
chore: enable CDI for kubevirt
hh Mar 13, 2024
94aa47e
chore: drive metro and plan via tfvars
hh Mar 13, 2024
c9f8d19
fix: eqiunix -> equinix
hh Mar 13, 2024
037d219
chore: make disk variables for talos and longhorn
BobyMCbobs Mar 13, 2024
26acf81
chore: remove flux receiver from flux management
BobyMCbobs Mar 13, 2024
18819a6
chore: add flux receiver for github to Terraform
BobyMCbobs Mar 13, 2024
79f2072
chore: enable config depends on infra
BobyMCbobs Mar 13, 2024
c275b4c
feat: add reflector
BobyMCbobs Mar 13, 2024
b49684a
chore: add interval to reflector helmrelease
BobyMCbobs Mar 13, 2024
4d8333d
fix: use reflector helmrepo in flux-system
BobyMCbobs Mar 13, 2024
408bb32
chore: Migrate away from http01>dns01 and reflector
hh Mar 13, 2024
39865c0
chore: update source ref for reflector
BobyMCbobs Mar 13, 2024
0ab2e90
chore: use the emberstack helm repo
hh Mar 13, 2024
61e7589
chore: label reflector helmrelease
BobyMCbobs Mar 13, 2024
eed8288
chore: add securityContext to reflector
BobyMCbobs Mar 13, 2024
ecb3b57
chore: use default seccompProfile for reflector
BobyMCbobs Mar 13, 2024
bf0b579
chore: fix namespace for reflector
BobyMCbobs Mar 13, 2024
ce1da56
chore: update flux-reciever ing tls secret
hh Mar 13, 2024
55c940f
fix: wildcard-ls -> wildcard-tls
hh Mar 14, 2024
51a27db
chore: use ens6f0 interface instead of bond0
hh Mar 14, 2024
c1eba2b
chore: use metallb resources with Equinix CCM
BobyMCbobs Mar 14, 2024
063333c
chore: rename module to generic name "cluster"
BobyMCbobs Mar 14, 2024
9529664
chore: add www.cloudnative.coop to wildcard-tls
hh Mar 14, 2024
2035ff7
chore: update try/coder-wildcard-tls
hh Mar 14, 2024
c22ea12
chore: consolidate try/coder.DOMAIN certs
hh Mar 14, 2024
c1f095a
chore: consolidate all certs into wildcard-tls
hh Mar 14, 2024
4d86759
chore: remove apps/coder/cert.yaml from kustomize
hh Mar 14, 2024
584ed34
chore: fix the wildcard-cert issue
hh Mar 14, 2024
0d238a2
chore: flux-webhook.DOMAIN use DNS01/wildcard-tls
hh Mar 14, 2024
de18a6d
chore: add authentik-override secret
hh Mar 16, 2024
15378aa
Add hh as a namespace to copy our certificate to.
hh Mar 27, 2024
afed140
Add talos.org with Equinix focus
hh Apr 10, 2024
f06fcdc
chore: ensure we don't commit our secret config
hh Apr 10, 2024
ad6186e
chore: delete values-example.tfvars
hh Apr 10, 2024
ff16cb2
chore: update talos to v1.7.0-beta.0
hh Apr 10, 2024
0819337
chore: Ensure ${var.domain} usage
hh Apr 10, 2024
3858447
chore: Make rfc2136_tsig_algorithm a variable
hh Apr 10, 2024
fb1ceba
chore: big space in prefix for talos_install_image
hh Apr 10, 2024
6f9725c
chore: add .envrc to .gitignore
hh Apr 10, 2024
d744eb1
chore: fix console=console=ttyS1 typo
hh Apr 10, 2024
3f7e0c2
chore: move cluster ips and dns into module
hh Apr 17, 2024
2e4025c
chore: move local variables into global variables
hh Apr 17, 2024
6692020
chore: add dns and http to cluster module
hh Apr 17, 2024
c774513
chore: refactor cluster module variables
hh Apr 17, 2024
971cde0
chore: upgrade coder and move dns into it's own file
hh Apr 17, 2024
3ded46f
chore: add dns based talosctl nodes/endpoints
hh Apr 17, 2024
caf3458
chore: update cluster_endpoint to use k8s.DOMAIN
hh Apr 17, 2024
c83ed29
chore: http pxe api generated talos_install_image
hh Apr 17, 2024
c85711f
chore: use talos beta auto bond creation
hh Apr 17, 2024
9c68d13
chore: More transition to dns based talos config
hh Apr 17, 2024
8752117
Add Flux sync manifests
Apr 17, 2024
96bff1f
chore: k8s node names must match metal device name
hh Apr 17, 2024
a879d93
chore: refactor naming and placing of resources
hh Apr 24, 2024
8716feb
feature: disableSearchDomain for talos/cluster DNS
hh Apr 24, 2024
6c12c96
chore: move coder.version to top level
hh Apr 24, 2024
a4b21b8
chore: bump AUTHENTIK_VERSION via kustomization
hh Apr 24, 2024
6fa4848
chore: fix create-admin job v${CODER_VERSION}
hh Apr 24, 2024
2599a2c
Delete create-admin-job while debugging
hh Apr 24, 2024
69ed416
chore: bump authentik to latest release
hh Apr 25, 2024
4f8b8ef
chore: start work on authentik tf code
hh Apr 25, 2024
3ac1d02
chore: adding current authentik configuration
hh Apr 26, 2024
0ed4ebe
chore: add top level authentik config
hh Apr 26, 2024
798b3d3
chore: use 64 char password for oidc id and secret
hh Apr 27, 2024
c79e565
add create-admin-job
hh Apr 27, 2024
4e22cbe
chore: add coder-override configmap to deployment
hh Apr 30, 2024
9f2a64b
chore: sychronize authentik work
hh May 3, 2024
49d7d90
chore: add non source / manual enrollment
hh May 3, 2024
533c908
chore: Install CAPI Operator and KubeVirt-Manager
hh May 4, 2024
e888056
chore: enable kubevirt and capi operators
hh May 4, 2024
ee4812e
chore: move kubevirt-operator into main kubevirt kustomization
hh May 4, 2024
44d75ad
chore: disable kubevirt-operator for now
hh May 4, 2024
3113332
chore: add kubevirt-manager ingress
hh May 4, 2024
6acaad5
chore: correct install.createNamespace: true
hh May 4, 2024
6a5cd0f
chore: bump cluster-api-operator
hh May 4, 2024
5ac448f
chore: add kubevirt-manager to cert reflector
hh May 4, 2024
8de0582
chore: bump Talos version to v1.7.1
hh May 4, 2024
583565a
chore: bump kubernetes to v1.30.0
hh May 4, 2024
ce2bb99
chore: add coder_override
hh May 4, 2024
3f12375
chore: deploy cilium
hh May 4, 2024
344d4d1
chore: save remander of authentik config
hh May 4, 2024
a7fe36d
chore: save updated provider config
hh May 4, 2024
f3cf456
chore: update README to reflect new .tfvars
hh May 4, 2024
43832dd
chore: gVisor requires unpriv user ns creation
hh May 6, 2024
4808fe4
chore: Add gvisor runtime class
hh May 6, 2024
50a1137
chore: Talos + kata + extensions
hh Jul 15, 2024
cf42f51
feat: add terraform for oci oke
BobyMCbobs Aug 22, 2024
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
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
.idea
*.log
tmp/
.envrc
.terraform
.terraform.lock.hcl
values.tfvars
config.org
secrets.org
config.tfvars
secrets.tfvars
61 changes: 25 additions & 36 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a Flux + Terraform infrastructure repo

* Todo

- [x] add Flux for sharing-io repo
- [x] add Flux for cluster repo
- [x] get talosconfig
- [ ] access Kubernetes APIServer
- [ ] verify Ceph disk allocation
Expand All @@ -15,74 +15,63 @@ a Flux + Terraform infrastructure repo

Install OpenTofu

#+begin_src shell
#+begin_src tmux :session ":tofu "
brew install opentofu
#+end_src

* Usage

vars:

- rfc2136_server
- rfc2136_tsig_keyname
- rfc2136_tsig_key
- equinix_metal_project_id
- equinix_metal_auth_token (DO NOT WRITE THIS DISK)
#+RESULTS:

keep in values.tfvars (as HCL); example:

#+begin_src hcl :tangle ./values-example.tfvars
rfc2136_server = "123.253.176.253"
rfc2136_tsig_keyname = "sharing.io."
rfc2136_tsig_key = "[VALUE HERE]"
equinix_metal_project_id = "82b5c425-8dd4-429e-ae0d-d32f265c63e4"
#+end_src
* Usage

init
You'll need .tfvar files, currently we create those via org files.

#+begin_src tmux
tofu init -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)" --upgrade
#+begin_src tmux :session ":tofu"
cd ~/infra
mkdir -p ./tmp/
touch ./tmp/cluster-kubeconfig
tofu init -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)" --upgrade
#+end_src

plan

#+begin_src tmux
tofu plan -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)"
#+begin_src tmux :session ":tofu"
tofu plan -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"
#+end_src

apply

#+begin_src tmux
tofu apply -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)"
#+begin_src tmux :session ":tofu"
tofu apply -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"
#+end_src

get talosconfig

#+begin_src tmux
CLUSTER_NAME=sharing-io
tofu output -raw "$CLUSTER_NAME"-talosconfig > ~/.talos/config-"$CLUSTER_NAME"
#+begin_src tmux :session ":talos"
mkdir -p ~/.talos
tofu output -raw talosconfig > ~/.talos/config
#+end_src

get kubeconfig

#+begin_src tmux
CLUSTER_NAME=sharing-io
tofu output -raw "$CLUSTER_NAME"-kubeconfig > ~/.kube/config-"$CLUSTER_NAME"
mkdir -p ~/.kube
tofu output -raw kubeconfig > ~/.kube/config
#+end_src

* Flux usage

force a reconciliation

#+begin_src shell :results silent
flux --kubeconfig ~/.kube/config-sharing-io reconcile source git flux-system
#+begin_src tmux
CLUSTER_NAME=cloudnative-coop
flux --kubeconfig ~/.kube/config-"$CLUSTER_NAME" reconcile source git flux-system
#+end_src

* Force tear down

#+begin_src tmux
tofu state list | grep -E 'talos|flux' | xargs -I{} tofu state rm {}
tofu destroy -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)"
#+begin_src tmux :session ":tofu"
tofu state list | grep -E 'talos|flux|manifests|kubernetes_manifest' | xargs -I{} tofu state rm {}
tofu destroy -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"
#+end_src

* Notes
Expand Down
21 changes: 21 additions & 0 deletions authentik.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module "cluster-authentik-config" {
source = "./terraform/authentik-config"
github_oauth_app_id = var.authentik_github_oauth_app_id
github_oauth_app_secret = var.authentik_github_oauth_app_secret
authentik_coder_oidc_client_id = module.cluster-manifests.authentik_coder_oidc_client_id
authentik_coder_oidc_client_secret = module.cluster-manifests.authentik_coder_oidc_client_secret
authentik_bootstrap_token = module.cluster-manifests.authentik_bootstrap_token
domain = var.domain
# repo = var.github_repository
# # repo = "${var.github_org}/${var.github_repository}"
# domain = "${var.domain}"
# secret = module.cluster-manifests.flux_receiver_token

providers = {
authentik = authentik
flux = flux
kubernetes = kubernetes.cluster
}

depends_on = [module.cluster-manifests]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
spec:
interval: 10m0s
path: ./infrastructure/configs
# dependsOn:
# - name: infrastructure
dependsOn:
- name: infrastructure
prune: true
wait: true
sourceRef:
Expand All @@ -18,3 +18,5 @@ spec:
substituteFrom:
- kind: Secret
name: rfc2136dnsserver
- kind: ConfigMap
name: coder-kustomize
2 changes: 1 addition & 1 deletion clusters/cluster/flux-system/gotk-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
branch: main
secretRef:
name: flux-system
url: ssh://git@github.com/ii/infra.git
url: ssh://git@github.com/sharingio/infra.git
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
Expand Down
Loading