diff --git a/k8s/configmap.yml b/k8s/configmap.yml new file mode 100644 index 0000000..734194d --- /dev/null +++ b/k8s/configmap.yml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: simplefilehub-config + namespace: exam-varga +data: + test.txt: | + lorem ipsum \ No newline at end of file diff --git a/k8s/deployment.yml b/k8s/deployment.yml new file mode 100644 index 0000000..c758767 --- /dev/null +++ b/k8s/deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: simplefilehub + namespace: exam-varga +spec: + replicas: 1 + selector: + matchLabels: + app: simplefilehub + template: + metadata: + labels: + app: simplefilehub + spec: + volumes: + - name: simplefilehub-config-volume + configMap: + name: simplefilehub-config + - name: simplefilehub-storage-volume + persistentVolumeClaim: + claimName: simplefilehub-pv-claim + + containers: + - name: simplefilehub + image: br0kenpixel/simplefilehub:latest + ports: + - containerPort: 8501 + volumeMounts: + - name: simplefilehub-storage-volume + mountPath: /app/storage + - name: simplefilehub-config-volume + mountPath: /app/configmapcontent \ No newline at end of file diff --git a/k8s/pv.yml b/k8s/pv.yml new file mode 100644 index 0000000..00e5a06 --- /dev/null +++ b/k8s/pv.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: simplefilehub-storage-volume + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/data" \ No newline at end of file diff --git a/k8s/pvc.yml b/k8s/pvc.yml new file mode 100644 index 0000000..ef64568 --- /dev/null +++ b/k8s/pvc.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: simplefilehub-pv-claim + namespace: exam-varga +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Mi \ No newline at end of file diff --git a/k8s/svc.yml b/k8s/svc.yml new file mode 100644 index 0000000..6154ab9 --- /dev/null +++ b/k8s/svc.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: simplefilehub-service + namespace: exam-varga +spec: + selector: + app: simplefilehub + type: NodePort + ports: + - port: 8501 + targetPort: 8501 + nodePort: 30000 \ No newline at end of file