aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-08-27 10:35:02 -0400
committerXe Iaso <me@xeiaso.net>2024-08-27 10:35:02 -0400
commit3a7ba512d5888c322597fb7599ec0b5d7b855ca6 (patch)
treeb4f89129de2738b03368c28fa3f8ac4c54f0cc80
parent2d92955cd59f1d5a70b75e66d7133872d395f561 (diff)
downloadx-3a7ba512d5888c322597fb7599ec0b5d7b855ca6.tar.xz
x-3a7ba512d5888c322597fb7599ec0b5d7b855ca6.zip
kube/alrest: more resources
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--kube/alrest/nfs-provisioner/kustomization.yaml15
-rw-r--r--kube/alrest/nfs-provisioner/namespace.yaml5
-rw-r--r--kube/alrest/nfs-provisioner/patch_nfs_details.yaml22
-rw-r--r--kube/alrest/vms/feixiao/feixiao.yaml90
-rw-r--r--kube/alrest/waifud/storageclass.yaml12
5 files changed, 144 insertions, 0 deletions
diff --git a/kube/alrest/nfs-provisioner/kustomization.yaml b/kube/alrest/nfs-provisioner/kustomization.yaml
new file mode 100644
index 0000000..91e28f4
--- /dev/null
+++ b/kube/alrest/nfs-provisioner/kustomization.yaml
@@ -0,0 +1,15 @@
+namespace: nfs-provisioner
+bases:
+ - github.com/kubernetes-sigs/nfs-subdir-external-provisioner//deploy
+resources:
+ - namespace.yaml
+patchesStrategicMerge:
+ - patch_nfs_details.yaml
+patches:
+- target:
+ kind: StorageClass
+ name: nfs-client
+ patch: |-
+ - op: replace
+ path: /metadata/name
+ value: itsuki \ No newline at end of file
diff --git a/kube/alrest/nfs-provisioner/namespace.yaml b/kube/alrest/nfs-provisioner/namespace.yaml
new file mode 100644
index 0000000..ff60d7d
--- /dev/null
+++ b/kube/alrest/nfs-provisioner/namespace.yaml
@@ -0,0 +1,5 @@
+# namespace.yaml
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: nfs-provisioner \ No newline at end of file
diff --git a/kube/alrest/nfs-provisioner/patch_nfs_details.yaml b/kube/alrest/nfs-provisioner/patch_nfs_details.yaml
new file mode 100644
index 0000000..1d4cbb5
--- /dev/null
+++ b/kube/alrest/nfs-provisioner/patch_nfs_details.yaml
@@ -0,0 +1,22 @@
+# patch_nfs_details.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ labels:
+ app: nfs-client-provisioner
+ name: nfs-client-provisioner
+spec:
+ template:
+ spec:
+ containers:
+ - name: nfs-client-provisioner
+ env:
+ - name: NFS_SERVER
+ value: 192.168.2.241
+ - name: NFS_PATH
+ value: /data/k8s
+ volumes:
+ - name: nfs-client-root
+ nfs:
+ server: 192.168.2.241
+ path: /data/k8s \ No newline at end of file
diff --git a/kube/alrest/vms/feixiao/feixiao.yaml b/kube/alrest/vms/feixiao/feixiao.yaml
new file mode 100644
index 0000000..2a6a003
--- /dev/null
+++ b/kube/alrest/vms/feixiao/feixiao.yaml
@@ -0,0 +1,90 @@
+apiVersion: cdi.kubevirt.io/v1beta1
+kind: DataVolume
+metadata:
+ name: "feixiao"
+ namespace: waifud
+ labels:
+ kubevirt.io/domain: feixiao
+spec:
+ storage:
+ storageClassName: longhorn-migratable
+ volumeMode: Block
+ accessModes:
+ - ReadWriteMany
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 64Gi
+ source:
+ http:
+ url: "https://cloud-images.ubuntu.com/daily/server/noble/current/noble-server-cloudimg-amd64.img"
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: feixiao
+ namespace: waifud
+ labels:
+ kubevirt.io/domain: "feixiao"
+spec:
+ ports:
+ # ssh
+ - port: 22
+ protocol: TCP
+ targetPort: 22
+ name: ssh
+ selector:
+ kubevirt.io/domain: "feixiao"
+---
+apiVersion: kubevirt.io/v1
+kind: VirtualMachine
+metadata:
+ labels:
+ kubevirt.io/os: linux
+ name: "feixiao"
+ namespace: waifud
+spec:
+ running: true
+ template:
+ metadata:
+ creationTimestamp: null
+ labels:
+ kubevirt.io/domain: "feixiao"
+ spec:
+ domain:
+ cpu:
+ cores: 2
+ devices:
+ disks:
+ - disk:
+ bus: virtio
+ name: disk0
+ - cdrom:
+ bus: sata
+ readonly: true
+ name: cloudinitdisk
+ machine:
+ type: q35
+ resources:
+ requests:
+ memory: 2048M
+ volumes:
+ - name: disk0
+ persistentVolumeClaim:
+ claimName: "feixiao"
+ - cloudInitNoCloud:
+ userData: |
+ #cloud-config
+ hostname: feixiao
+ ssh_pwauth: True
+ disable_root: false
+
+ users:
+ - name: xe
+ groups: [ wheel ]
+ sudo: [ "ALL=(ALL) NOPASSWD:ALL" ]
+ shell: /bin/bash
+ ssh-authorized-keys:
+ - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF6/+q2dBHEfETomAH7rvDPXHulSXnhcV/szxTAWiKZA cadey@defoko
+ - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJIH27tCTJZwJxp+bcWRALtrk7SqnwXZ4/Ae67jIO0eF cadey@shiroko
+ name: cloudinitdisk \ No newline at end of file
diff --git a/kube/alrest/waifud/storageclass.yaml b/kube/alrest/waifud/storageclass.yaml
new file mode 100644
index 0000000..d3ac831
--- /dev/null
+++ b/kube/alrest/waifud/storageclass.yaml
@@ -0,0 +1,12 @@
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+ name: longhorn-migratable
+provisioner: driver.longhorn.io
+allowVolumeExpansion: true
+parameters:
+ numberOfReplicas: "3"
+ staleReplicaTimeout: "2880" # 48 hours in minutes
+ fromBackup: ""
+ migratable: "true"
+ replicaAutoBalance: "least-effort" \ No newline at end of file