From 8f0c9c17b99dace9776d3299fd6de427c0cb633c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 17 Oct 2024 14:55:46 +0200 Subject: [PATCH] re-order section for reseting the cluster so that they can be applied in order --- README.md | 158 +++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index ff96053..2b0790f 100644 --- a/README.md +++ b/README.md @@ -832,27 +832,6 @@ curl -fL https://get.k3s.io | sh -s - server --cluster-init --disable=servicelb curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - ``` -Define the nfs storage class. - -```sh -$ cat nfs.yml -apiVersion: helm.cattle.io/v1 -kind: HelmChart -metadata: - name: nfs - namespace: default -spec: - chart: nfs-subdir-external-provisioner - repo: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner - targetNamespace: default - set: - nfs.server: 10.53.101.5 - nfs.path: /k8s - storageClass.name: nfs -$ kubectl apply --server-side=true -f nfs.yml -$ kubectl get storageclass nfs -``` - ### k8s second server node The token is found on the first node in the `/var/lib/rancher/k3s/server/token` file. @@ -866,64 +845,6 @@ curl -fL https://get.k3s.io | sh -s - server --token $token --server https://$ma curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - ``` -### k8s NFS storage creation - -Create the directory to be used, with the expected permissions (assuing `/k8s` is the directory exported via NFS). - -```sh -sudo mkdir /precious/k8s/forgejo-data -sudo chmod 1000:1000 /precious/k8s/forgejo-data -``` - -Define the `forgejo-data` pvc. - -```sh -$ cat pv.yml ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: forgejo-data -spec: - capacity: - storage: 20Gi - nfs: - server: 10.53.101.5 - path: /k8s/forgejo-data - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - storageClassName: nfs - mountOptions: - - noatime - - nfsvers=4.2 - volumeMode: Filesystem ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: forgejo-data -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 20Gi - volumeName: forgejo-data - storageClassName: nfs - volumeMode: Filesystem -$ kubectl apply --server-side=true -f pv.yml -``` - -[Instruct the forgejo pod](https://code.forgejo.org/forgejo-helm/forgejo-helm#persistence) to use the `forgejo-data` pvc. - -```yaml -persistence: - enabled: true - create: false - claimName: forgejo-data -``` - ### k8s dedicated etcd node [dedicated etcd node](https://docs.k3s.io/installation/server-roles#dedicated-etcd-nodes) @@ -1050,6 +971,85 @@ service: port: 2222 ``` +Define the nfs storage class. + +```sh +$ cat nfs.yml +apiVersion: helm.cattle.io/v1 +kind: HelmChart +metadata: + name: nfs + namespace: default +spec: + chart: nfs-subdir-external-provisioner + repo: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner + targetNamespace: default + set: + nfs.server: 10.53.101.5 + nfs.path: /k8s + storageClass.name: nfs +$ kubectl apply --server-side=true -f nfs.yml +$ sleep 120 ; kubectl get storageclass nfs +``` + +### k8s NFS storage creation + +Create the directory to be used, with the expected permissions (assuing `/k8s` is the directory exported via NFS). + +```sh +sudo mkdir /precious/k8s/forgejo-data +sudo chmod 1000:1000 /precious/k8s/forgejo-data +``` + +Define the `forgejo-data` pvc. + +```sh +$ cat pv.yml +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: forgejo-data +spec: + capacity: + storage: 20Gi + nfs: + server: 10.53.101.5 + path: /k8s/forgejo-data + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + mountOptions: + - noatime + - nfsvers=4.2 + volumeMode: Filesystem +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: forgejo-data +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 20Gi + volumeName: forgejo-data + storageClassName: nfs + volumeMode: Filesystem +$ kubectl apply --server-side=true -f pv.yml +``` + +[Instruct the forgejo pod](https://code.forgejo.org/forgejo-helm/forgejo-helm#persistence) to use the `forgejo-data` pvc. + +```yaml +persistence: + enabled: true + create: false + claimName: forgejo-data +``` + ## Uberspace The website https://forgejo.org is hosted at