diff --git a/.gitignore b/.gitignore index f157f21..2195681 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .env - +*.secret.yaml .DS_Store -.idea \ No newline at end of file +.idea diff --git a/k8s/aeris/templates/back.deployment.yaml b/k8s/aeris/templates/back.deployment.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/k8s/aeris/templates/back/back.deployment.yaml b/k8s/aeris/templates/back/back.deployment.yaml new file mode 100644 index 0000000..ca291e9 --- /dev/null +++ b/k8s/aeris/templates/back/back.deployment.yaml @@ -0,0 +1 @@ +version \ No newline at end of file diff --git a/k8s/aeris/templates/back.service.yaml b/k8s/aeris/templates/back/back.service.yaml similarity index 100% rename from k8s/aeris/templates/back.service.yaml rename to k8s/aeris/templates/back/back.service.yaml diff --git a/k8s/aeris/templates/front.deployment.yaml b/k8s/aeris/templates/front/front.deployment.yaml similarity index 100% rename from k8s/aeris/templates/front.deployment.yaml rename to k8s/aeris/templates/front/front.deployment.yaml diff --git a/k8s/aeris/templates/front.service.yaml b/k8s/aeris/templates/front/front.service.yaml similarity index 100% rename from k8s/aeris/templates/front.service.yaml rename to k8s/aeris/templates/front/front.service.yaml diff --git a/k8s/aeris/templates/postgres.configmap.yaml b/k8s/aeris/templates/postgres.configmap.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/k8s/aeris/templates/postgres.deployment.yaml b/k8s/aeris/templates/postgres.deployment.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/k8s/aeris/templates/postgres.secret.yaml b/k8s/aeris/templates/postgres.secret.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/k8s/aeris/templates/postgres.service.yaml b/k8s/aeris/templates/postgres.service.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/k8s/aeris/templates/postgres/postgres.configmap.yaml b/k8s/aeris/templates/postgres/postgres.configmap.yaml new file mode 100644 index 0000000..8efd3a7 --- /dev/null +++ b/k8s/aeris/templates/postgres/postgres.configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: configmap-postgres +data: + POSTGRES_HOST: "postgres-service" + POSTGRES_PORT: "5432" + POSTGRES_DB: "aeris" + PGDATA: /var/lib/postgresql/data/d \ No newline at end of file diff --git a/k8s/aeris/templates/postgres/postgres.deployment.yaml b/k8s/aeris/templates/postgres/postgres.deployment.yaml new file mode 100644 index 0000000..5687377 --- /dev/null +++ b/k8s/aeris/templates/postgres/postgres.deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: postgres + template: + metadata: + name: postgres + labels: + app: postgres + spec: + containers: + - name: postgres + image: postgres:12 + ports: + - containerPort: 5432 + hostPort: 5432 + volumeMounts: + - mountPath: "/var/lib/postgresql/data" + name: postgres-volume-claim + envFrom: + - configMapRef: + name: configmap-postgres + - secretRef: + name: secret-postgres + volumes: + - name: postgres-volume-claim + persistentVolumeClaim: + claimName: volume-claim-postgres + restartPolicy: Always \ No newline at end of file diff --git a/k8s/aeris/templates/postgres/postgres.service.yaml b/k8s/aeris/templates/postgres/postgres.service.yaml new file mode 100644 index 0000000..6dbca56 --- /dev/null +++ b/k8s/aeris/templates/postgres/postgres.service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgres-service +spec: + type: ClusterIP + selector: + app: postgres + ports: + - port: 5432 + targetPort: 5432 \ No newline at end of file diff --git a/k8s/aeris/templates/postgres/postgres.volume.yaml b/k8s/aeris/templates/postgres/postgres.volume.yaml new file mode 100644 index 0000000..eec6598 --- /dev/null +++ b/k8s/aeris/templates/postgres/postgres.volume.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: volume-postgres + labels: + type: local + name: volume-postgres +spec: + storageClassName: manual + capacity: + storage: 200M + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/data" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: volume-claim-postgres +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200M \ No newline at end of file diff --git a/k8s/aeris/templates/worker.deployment.yaml b/k8s/aeris/templates/worker/worker.deployment.yaml similarity index 100% rename from k8s/aeris/templates/worker.deployment.yaml rename to k8s/aeris/templates/worker/worker.deployment.yaml diff --git a/k8s/aeris/templates/worker.service.yaml b/k8s/aeris/templates/worker/worker.service.yaml similarity index 100% rename from k8s/aeris/templates/worker.service.yaml rename to k8s/aeris/templates/worker/worker.service.yaml