diff --git a/kube/elasticsearch/elasticsearch-deployment.yaml b/kube/base-components/elasticsearch-deployment.yaml similarity index 98% rename from kube/elasticsearch/elasticsearch-deployment.yaml rename to kube/base-components/elasticsearch-deployment.yaml index 30c1add..25bd918 100644 --- a/kube/elasticsearch/elasticsearch-deployment.yaml +++ b/kube/base-components/elasticsearch-deployment.yaml @@ -58,7 +58,7 @@ spec: - name: es-data persistentVolumeClaim: claimName: es-pvc - - name: elasticsearch-config + - name: elasticsearch-,.ujv config configMap: name: elasticsearch-config --- @@ -97,7 +97,6 @@ spec: resources: requests: storage: 80Gi - --- # Elasticsearch Service apiVersion: v1 diff --git a/kube/elasticsearch/kibana-deployment.yaml b/kube/base-components/kibana-deployment.yaml similarity index 100% rename from kube/elasticsearch/kibana-deployment.yaml rename to kube/base-components/kibana-deployment.yaml diff --git a/kube/base-components/postgresql-deployment.yaml b/kube/base-components/postgresql-deployment.yaml new file mode 100644 index 0000000..25c9e9f --- /dev/null +++ b/kube/base-components/postgresql-deployment.yaml @@ -0,0 +1,90 @@ +# Persistent Volume +apiVersion: v1 +kind: PersistentVolume +metadata: + name: postgres-pv +spec: + capacity: + storage: 80Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: do-block-storage + hostPath: + path: /mnt/data/postgres +--- +# Persistent Volume Claim +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: postgres-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 80Gi + volumeName: postgres-pv + storageClassName: do-block-storage +--- +# Postgresql deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres +spec: + replicas: 1 + selector: + matchLabels: + app: postgres + template: + metadata: + labels: + app: postgres + spec: + containers: + - name: postgres + image: postgres:13 + ports: + - containerPort: 5432 + env: + - name: POSTGRES_DB + value: starcoin + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgresql + key: username + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgresql + key: password + resources: + requests: + memory: "4Gi" + cpu: "2" + limits: + memory: "4Gi" + cpu: "2" + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: postgres-storage + volumes: + - name: postgres-storage + persistentVolumeClaim: + claimName: postgres-pvc +--- +# Service +apiVersion: v1 +kind: Service +metadata: + name: postgres-service +spec: + type: ClusterIP + ports: + - port: 5432 + targetPort: 5432 + selector: + app: postgres +