From 8f7492915bb2a15e07f1eb8f8c39b52b4a0ffc03 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli <35596795+meysamhadeli@users.noreply.github.com> Date: Wed, 7 Aug 2024 00:01:15 +0330 Subject: [PATCH] ci: Update deployments configurations. --- .gitignore | 3 + .../docker-compose/docker-compose.yaml | 36 +++--- .../docker-compose/infrastructure.yaml | 30 +++-- .../kubernetes/booking-microservices.yml | 115 ++++++++++-------- 4 files changed, 97 insertions(+), 87 deletions(-) diff --git a/.gitignore b/.gitignore index d068408..f5d5dc8 100644 --- a/.gitignore +++ b/.gitignore @@ -437,3 +437,6 @@ fabric.properties # Monitoring **/grafana-data + +# EventStore +**/eventstore diff --git a/deployments/docker-compose/docker-compose.yaml b/deployments/docker-compose/docker-compose.yaml index 0f4758f..8cedd52 100644 --- a/deployments/docker-compose/docker-compose.yaml +++ b/deployments/docker-compose/docker-compose.yaml @@ -75,23 +75,19 @@ services: # EventStoreDB ####################################################### eventstore: - container_name: eventstore - image: eventstore/eventstore:latest - restart: unless-stopped - environment: - - EVENTSTORE_CLUSTER_SIZE=1 - - EVENTSTORE_RUN_PROJECTIONS=All - - EVENTSTORE_START_STANDARD_PROJECTIONS=true - - EVENTSTORE_EXT_TCP_PORT=1113 - - EVENTSTORE_EXT_HTTP_PORT=2113 - - EVENTSTORE_INSECURE=true - - EVENTSTORE_ENABLE_EXTERNAL_TCP=true - - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true - ports: - - '1113:1113' - - '2113:2113' - networks: - - booking + container_name: eventstore + image: eventstore/eventstore:latest + environment: + - EVENTSTORE_CLUSTER_SIZE=1 + - EVENTSTORE_RUN_PROJECTIONS=All + - EVENTSTORE_START_STANDARD_PROJECTIONS=True + - EVENTSTORE_HTTP_PORT=2113 + - EVENTSTORE_INSECURE=True + - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=True + ports: + - "2113:2113" + networks: + - booking ####################################################### @@ -185,9 +181,11 @@ services: - '--path.rootfs=/host' pid: host volumes: - - '/:/host:ro,rslave' + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro networks: - - booking + - booking ####################################################### # cadvisor diff --git a/deployments/docker-compose/infrastructure.yaml b/deployments/docker-compose/infrastructure.yaml index 362c6c6..e9ec751 100644 --- a/deployments/docker-compose/infrastructure.yaml +++ b/deployments/docker-compose/infrastructure.yaml @@ -78,19 +78,15 @@ services: eventstore: container_name: eventstore image: eventstore/eventstore:latest - restart: unless-stopped environment: - - EVENTSTORE_CLUSTER_SIZE=1 - - EVENTSTORE_RUN_PROJECTIONS=All - - EVENTSTORE_START_STANDARD_PROJECTIONS=true - - EVENTSTORE_EXT_TCP_PORT=1113 - - EVENTSTORE_EXT_HTTP_PORT=2113 - - EVENTSTORE_INSECURE=true - - EVENTSTORE_ENABLE_EXTERNAL_TCP=true - - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true + - EVENTSTORE_CLUSTER_SIZE=1 + - EVENTSTORE_RUN_PROJECTIONS=All + - EVENTSTORE_START_STANDARD_PROJECTIONS=True + - EVENTSTORE_HTTP_PORT=2113 + - EVENTSTORE_INSECURE=True + - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=True ports: - - '1113:1113' - - '2113:2113' + - "2113:2113" networks: - booking @@ -186,7 +182,7 @@ services: volumes: - ./monitoring/grafana-data/data:/var/lib/grafana networks: - - booking + - booking ####################################################### # node_exporter @@ -199,9 +195,11 @@ services: - '--path.rootfs=/host' pid: host volumes: - - '/:/host:ro,rslave' + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro networks: - - booking + - booking ####################################################### # cadvisor @@ -222,8 +220,8 @@ services: - /dev/kmsg networks: - booking - - + + networks: booking: diff --git a/deployments/kubernetes/booking-microservices.yml b/deployments/kubernetes/booking-microservices.yml index 38a81c8..5a1ac92 100644 --- a/deployments/kubernetes/booking-microservices.yml +++ b/deployments/kubernetes/booking-microservices.yml @@ -172,67 +172,65 @@ status: ####################################################### # Event Store ####################################################### -apiVersion: v1 -kind: Pod +apiVersion: apps/v1 +kind: Deployment metadata: annotations: - kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe -f infrastracture.yaml convert - kompose.version: 1.28.0 (c4137012e) - creationTimestamp: null + kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastructure.yaml + kompose.version: 1.34.0 (cbf2835db) labels: - io.kompose.network/booking: "true" io.kompose.service: eventstore name: eventstore spec: - containers: - - env: - - name: EVENTSTORE_CLUSTER_SIZE - value: "1" - - name: EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP - value: "true" - - name: EVENTSTORE_ENABLE_EXTERNAL_TCP - value: "true" - - name: EVENTSTORE_EXT_HTTP_PORT - value: "2113" - - name: EVENTSTORE_EXT_TCP_PORT - value: "1113" - - name: EVENTSTORE_INSECURE - value: "true" - - name: EVENTSTORE_RUN_PROJECTIONS - value: All - - name: EVENTSTORE_START_STANDARD_PROJECTIONS - value: "true" - image: eventstore/eventstore:latest - name: eventstore - ports: - - containerPort: 1113 - - containerPort: 2113 - resources: {} - restartPolicy: Always -status: {} + replicas: 1 + selector: + matchLabels: + io.kompose.service: eventstore + template: + metadata: + annotations: + kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastructure.yaml + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: eventstore + spec: + containers: + - env: + - name: EVENTSTORE_CLUSTER_SIZE + value: "1" + - name: EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP + value: "True" + - name: EVENTSTORE_HTTP_PORT + value: "2113" + - name: EVENTSTORE_INSECURE + value: "True" + - name: EVENTSTORE_RUN_PROJECTIONS + value: All + - name: EVENTSTORE_START_STANDARD_PROJECTIONS + value: "True" + image: eventstore/eventstore:latest + name: eventstore + ports: + - containerPort: 2113 + protocol: TCP + restartPolicy: Always --- apiVersion: v1 kind: Service metadata: annotations: - kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe -f infrastracture.yaml convert - kompose.version: 1.28.0 (c4137012e) - creationTimestamp: null + kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastructure.yaml + kompose.version: 1.34.0 (cbf2835db) labels: io.kompose.service: eventstore name: eventstore spec: ports: - - name: "1113" - port: 1113 - targetPort: 1113 - name: "2113" port: 2113 targetPort: 2113 selector: io.kompose.service: eventstore -status: - loadBalancer: {} --- # ####################################################### # # Jaeger @@ -494,9 +492,8 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastracture.yaml - kompose.version: 1.28.0 (c4137012e) - creationTimestamp: null + kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastructure.yaml + kompose.version: 1.34.0 (cbf2835db) labels: io.kompose.service: node-exporter name: node-exporter @@ -510,11 +507,9 @@ spec: template: metadata: annotations: - kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastracture.yaml - kompose.version: 1.28.0 (c4137012e) - creationTimestamp: null + kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe convert -f infrastructure.yaml + kompose.version: 1.34.0 (cbf2835db) labels: - io.kompose.network/newfolder-booking: "true" io.kompose.service: node-exporter spec: containers: @@ -522,23 +517,27 @@ spec: - --path.rootfs=/host image: quay.io/prometheus/node-exporter:latest name: node-exporter - resources: {} volumeMounts: - - mountPath: /host + - mountPath: /host/proc name: node-exporter-claim0 readOnly: true + - mountPath: /host/sys + name: node-exporter-claim1 + readOnly: true restartPolicy: Always volumes: - name: node-exporter-claim0 persistentVolumeClaim: claimName: node-exporter-claim0 readOnly: true -status: {} + - name: node-exporter-claim1 + persistentVolumeClaim: + claimName: node-exporter-claim1 + readOnly: true --- apiVersion: v1 kind: PersistentVolumeClaim metadata: - creationTimestamp: null labels: io.kompose.service: node-exporter-claim0 name: node-exporter-claim0 @@ -548,7 +547,19 @@ spec: resources: requests: storage: 100Mi -status: {} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: node-exporter-claim1 + name: node-exporter-claim1 +spec: + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 100Mi --- # ####################################################### # # Cadvisor