Add CoreDNS config
This commit is contained in:
17
README.md
17
README.md
@@ -1,5 +1,20 @@
|
|||||||
## Homelab
|
# Homelab
|
||||||
|
|
||||||
|
## Steps to Bootstrap From scratch
|
||||||
|
1. Install k3s in all nodes (out of the scope of this document)
|
||||||
|
- To install the server run `mage installk3s`
|
||||||
|
- To install worker nodes run `mage installk3s_worker`, you will get the node token.
|
||||||
|
- Run inside of all nodes that are going to be workers:
|
||||||
|
```sh
|
||||||
|
curl -sfL https://get.k3s.io | K3S_URL=https://hydra-0:6443 K3S_TOKEN=<node_token> sh -s -
|
||||||
|
```
|
||||||
|
2. Import Kubeconfig with `./scripts/get_kubeconfig.sh`
|
||||||
|
3. Bootstrap Flux
|
||||||
|
- Run:
|
||||||
|
```sh
|
||||||
|
flux --kubeconfig ~/.kube/hydra bootstrap gitea --token-auth --hostname=danicos.dev --owner=daniel --repository=homelab --private=false --branch=main --personal=true --path=./clusters/hydra
|
||||||
|
```
|
||||||
|
- Run `./scripts/create_flux_secret.sh` to allow for SOPS Decription
|
||||||
|
|
||||||
## GitOps
|
## GitOps
|
||||||
A set of "best practices" where the entire code delivery process is controlled via Git, including infrastructure and application definition as code and automation to complete updates and rollbacks.
|
A set of "best practices" where the entire code delivery process is controlled via Git, including infrastructure and application definition as code and automation to complete updates and rollbacks.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
|||||||
# This manifest was generated by flux. DO NOT EDIT.
|
|
||||||
---
|
|
||||||
apiVersion: source.toolkit.fluxcd.io/v1
|
|
||||||
kind: GitRepository
|
|
||||||
metadata:
|
|
||||||
name: flux-system
|
|
||||||
namespace: flux-system
|
|
||||||
spec:
|
|
||||||
interval: 1m0s
|
|
||||||
ref:
|
|
||||||
branch: main
|
|
||||||
secretRef:
|
|
||||||
name: flux-system
|
|
||||||
url: https://danicos.dev/daniel/homelab.git
|
|
||||||
---
|
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
|
||||||
kind: Kustomization
|
|
||||||
metadata:
|
|
||||||
name: flux-system
|
|
||||||
namespace: flux-system
|
|
||||||
spec:
|
|
||||||
interval: 10m0s
|
|
||||||
path: ./clusters/hydra
|
|
||||||
prune: true
|
|
||||||
sourceRef:
|
|
||||||
kind: GitRepository
|
|
||||||
name: flux-system
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- gotk-components.yaml
|
|
||||||
- gotk-sync.yaml
|
|
||||||
12
infrastructure/hydra/coredns-config.yaml
Normal file
12
infrastructure/hydra/coredns-config.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: coredns-custom
|
||||||
|
namespace: kube-system
|
||||||
|
data:
|
||||||
|
tailscale.server: |
|
||||||
|
ts.net:53 {
|
||||||
|
errors
|
||||||
|
cache 30
|
||||||
|
forward . 100.100.100.100
|
||||||
|
}
|
||||||
@@ -8,7 +8,5 @@ echo WORKER: $HYDRA_WORKER
|
|||||||
|
|
||||||
NODE_TOKEN=$(ssh $LINUX_ADMIN@$CLUSTER_HOST "sudo cat /var/lib/rancher/k3s/server/node-token")
|
NODE_TOKEN=$(ssh $LINUX_ADMIN@$CLUSTER_HOST "sudo cat /var/lib/rancher/k3s/server/node-token")
|
||||||
echo $NODE_TOKEN
|
echo $NODE_TOKEN
|
||||||
# curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --server https://k3s.example.com --token mypassword" sh -s -
|
|
||||||
# curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent" K3S_TOKEN="mypassword" sh -s - --server https://k3s.example.com
|
# curl -sfL https://get.k3s.io | K3S_URL=https://hydra-0:6443 K3S_TOKEN=<node_token> sh -s -
|
||||||
# curl -sfL https://get.k3s.io | K3S_URL=https://k3s.example.com sh -s - agent --token mypassword
|
|
||||||
# curl -sfL https://get.k3s.io | K3S_URL=https://k3s.example.com K3S_TOKEN=mypassword sh -s - # agent is assumed because of K3S_URL
|
|
||||||
|
|||||||
Reference in New Issue
Block a user