diff --git a/k8s/infra/longhorn/Chart.yaml b/k8s/infra/longhorn/Chart.yaml deleted file mode 100644 index 76a31a0..0000000 --- a/k8s/infra/longhorn/Chart.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v2 -name: longhorn -description: A Helm chart for Kubernetes -type: application -version: 0.1.0 -# dependencies: -# - name: longhorn -# version: v1.4.0 -# repository: https://charts.longhorn.io diff --git a/k8s/infra/longhorn/templates/ingress.yaml b/k8s/infra/longhorn/templates/ingress.yaml deleted file mode 100644 index d78ca50..0000000 --- a/k8s/infra/longhorn/templates/ingress.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: longhorn -spec: - rules: - - host: "longhorn.{{ .Values.global.domain }}" - http: - paths: - - backend: - service: - name: longhorn-frontend - port: - number: 80 - path: / - pathType: Prefix diff --git a/k8s/infra/longhorn/templates/iscsi.yaml b/k8s/infra/longhorn/templates/iscsi.yaml deleted file mode 100644 index bd4903c..0000000 --- a/k8s/infra/longhorn/templates/iscsi.yaml +++ /dev/null @@ -1,40 +0,0 @@ -{{- if .Values.custom.useDaemons -}} ---- -# source: https://raw.githubusercontent.com/longhorn/longhorn/v1.4.0/deploy/prerequisite/iscsi-installation.yaml -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: iscsi-installation - labels: - app: iscsi-installation - annotations: - command: &cmd OS=$(grep -E "^ID_LIKE=" /etc/os-release | cut -d '=' -f 2); if [[ -z "${OS}" ]]; then OS=$(grep -E "^ID=" /etc/os-release | cut -d '=' -f 2); fi; if [[ "${OS}" == *"debian"* ]]; then sudo apt-get update -q -y && sudo apt-get install -q -y open-iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; elif [[ "${OS}" == *"suse"* ]]; then sudo zypper --gpg-auto-import-keys -q refresh && sudo zypper --gpg-auto-import-keys -q install -y open-iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; else sudo yum makecache -q -y && sudo yum --setopt=tsflags=noscripts install -q -y iscsi-initiator-utils && echo "InitiatorName=$(/sbin/iscsi-iname)" > /etc/iscsi/initiatorname.iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; fi && if [ $? -eq 0 ]; then echo "iscsi install successfully"; else echo "iscsi install failed error code $?"; fi -spec: - selector: - matchLabels: - app: iscsi-installation - template: - metadata: - labels: - app: iscsi-installation - spec: - hostNetwork: true - hostPID: true - initContainers: - - name: iscsi-installation - command: - - nsenter - - --mount=/proc/1/ns/mnt - - -- - - bash - - -c - - *cmd - image: alpine:3.12 - securityContext: - privileged: true - containers: - - name: sleep - image: k8s.gcr.io/pause:3.1 - updateStrategy: - type: RollingUpdate -{{- end -}} diff --git a/k8s/infra/longhorn/templates/nfs.yaml b/k8s/infra/longhorn/templates/nfs.yaml deleted file mode 100644 index e63d503..0000000 --- a/k8s/infra/longhorn/templates/nfs.yaml +++ /dev/null @@ -1,40 +0,0 @@ -{{- if .Values.custom.useDaemons -}} ---- -# source: https://raw.githubusercontent.com/longhorn/longhorn/v1.4.0/deploy/prerequisite/longhorn-nfs-installation.yaml -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: nfs-installation - labels: - app: nfs-installation - annotations: - command: &cmd OS=$(grep -E "^ID_LIKE=" /etc/os-release | cut -d '=' -f 2); if [[ -z "${OS}" ]]; then OS=$(grep -E "^ID=" /etc/os-release | cut -d '=' -f 2); fi; if [[ "${OS}" == *"debian"* ]]; then sudo apt-get update -q -y && sudo apt-get install -q -y nfs-common && sudo modprobe nfs; elif [[ "${OS}" == *"suse"* ]]; then sudo zypper --gpg-auto-import-keys -q refresh && sudo zypper --gpg-auto-import-keys -q install -y nfs-client && sudo modprobe nfs; else sudo yum makecache -q -y && sudo yum --setopt=tsflags=noscripts install -q -y nfs-utils && sudo modprobe nfs; fi && if [ $? -eq 0 ]; then echo "nfs install successfully"; else echo "nfs install failed error code $?"; fi -spec: - selector: - matchLabels: - app: nfs-installation - template: - metadata: - labels: - app: nfs-installation - spec: - hostNetwork: true - hostPID: true - initContainers: - - name: nfs-installation - command: - - nsenter - - --mount=/proc/1/ns/mnt - - -- - - bash - - -c - - *cmd - image: alpine:3.12 - securityContext: - privileged: true - containers: - - name: sleep - image: k8s.gcr.io/pause:3.1 - updateStrategy: - type: RollingUpdate -{{- end -}} \ No newline at end of file diff --git a/k8s/infra/longhorn/.helmignore b/k8s/infra/storage/.helmignore similarity index 100% rename from k8s/infra/longhorn/.helmignore rename to k8s/infra/storage/.helmignore diff --git a/k8s/infra/storage/Chart.yaml b/k8s/infra/storage/Chart.yaml new file mode 100644 index 0000000..1d63c2e --- /dev/null +++ b/k8s/infra/storage/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: storage +description: Storage configuration +type: application +version: 0.1.0 diff --git a/k8s/infra/storage/templates/nfs-stroage-class.yaml b/k8s/infra/storage/templates/nfs-stroage-class.yaml new file mode 100644 index 0000000..69ee74d --- /dev/null +++ b/k8s/infra/storage/templates/nfs-stroage-class.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: truenas-scale-nfs-family-storage +provisioner: nfs.csi.k8s.io +parameters: + server: http://truenas.local/ + share: /FamilyNFS +reclaimPolicy: Retain +volumeBindingMode: Immediate +mountOptions: + - nfsvers=4.1 diff --git a/k8s/infra/longhorn/values-dev.yaml b/k8s/infra/storage/values-dev.yaml similarity index 100% rename from k8s/infra/longhorn/values-dev.yaml rename to k8s/infra/storage/values-dev.yaml diff --git a/k8s/infra/longhorn/values-prod.yaml b/k8s/infra/storage/values-prod.yaml similarity index 100% rename from k8s/infra/longhorn/values-prod.yaml rename to k8s/infra/storage/values-prod.yaml diff --git a/k8s/infra/longhorn/values.yaml b/k8s/infra/storage/values.yaml similarity index 100% rename from k8s/infra/longhorn/values.yaml rename to k8s/infra/storage/values.yaml diff --git a/temp.json b/temp.json index e70e152..86b268b 100644 --- a/temp.json +++ b/temp.json @@ -2,15 +2,17 @@ "apiVersion": "v1", "kind": "Namespace", "metadata": { - "creationTimestamp": "2023-03-15T19:06:12Z", - "deletionTimestamp": "2023-03-16T01:21:58Z", - "labels": { - "kubernetes.io/metadata.name": "argocd", - "name": "argocd" + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"creationTimestamp\":null,\"name\":\"kubernetes-dashboard\"},\"spec\":{},\"status\":{}}\n" }, - "name": "argocd", - "resourceVersion": "2102061", - "uid": "ba44729d-fddb-4c59-b039-f0d5b206709f" + "creationTimestamp": "2023-03-18T02:33:43Z", + "deletionTimestamp": "2023-03-18T02:56:42Z", + "labels": { + "kubernetes.io/metadata.name": "kubernetes-dashboard" + }, + "name": "kubernetes-dashboard", + "resourceVersion": "2178986", + "uid": "d8d91bf1-db57-4add-b1e1-28e237cb9f2d" }, "spec": { "finalizers": [] @@ -18,38 +20,38 @@ "status": { "conditions": [ { - "lastTransitionTime": "2023-03-16T01:22:05Z", + "lastTransitionTime": "2023-03-18T02:56:48Z", "message": "All resources successfully discovered", "reason": "ResourcesDiscovered", "status": "False", "type": "NamespaceDeletionDiscoveryFailure" }, { - "lastTransitionTime": "2023-03-16T01:22:05Z", + "lastTransitionTime": "2023-03-18T02:56:48Z", "message": "All legacy kube types successfully parsed", "reason": "ParsedGroupVersions", "status": "False", "type": "NamespaceDeletionGroupVersionParsingFailure" }, { - "lastTransitionTime": "2023-03-16T01:22:05Z", - "message": "All content successfully deleted, may be waiting on finalization", - "reason": "ContentDeleted", - "status": "False", + "lastTransitionTime": "2023-03-18T02:57:26Z", + "message": "Failed to delete all resource types, 1 remaining: unexpected items still remain in namespace: kubernetes-dashboard for gvr: /v1, Resource=pods", + "reason": "ContentDeletionFailed", + "status": "True", "type": "NamespaceDeletionContentFailure" }, { - "lastTransitionTime": "2023-03-16T01:22:05Z", - "message": "Some resources are remaining: applications.argoproj.io has 6 resource instances, appprojects.argoproj.io has 1 resource instances", + "lastTransitionTime": "2023-03-18T02:56:48Z", + "message": "Some resources are remaining: pods. has 1 resource instances", "reason": "SomeResourcesRemain", "status": "True", "type": "NamespaceContentRemaining" }, { - "lastTransitionTime": "2023-03-16T01:22:05Z", - "message": "Some content in the namespace has finalizers remaining: resources-finalizer.argocd.argoproj.io in 7 resource instances", - "reason": "SomeFinalizersRemain", - "status": "True", + "lastTransitionTime": "2023-03-18T02:56:48Z", + "message": "All content-preserving finalizers finished", + "reason": "ContentHasNoFinalizers", + "status": "False", "type": "NamespaceFinalizersRemaining" } ],