From efc5fe56bf3fe494fe9afc24eae73fd3f3e0cad2 Mon Sep 17 00:00:00 2001 From: LucasDantas Date: Thu, 4 Aug 2022 22:19:43 -0300 Subject: [PATCH 1/7] manifesto e dockerfile --- k8s/deployment.yaml | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 k8s/deployment.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 000000000..8c3a50187 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,76 @@ +# Deploymente +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgre +spec: + selector: + matchLabels: + app: postgre + template: + metadata: + labels: + app: postgre + spec: + containers: + - name: postgre + image: postgres:14.4 + ports: + - containerPort: 5432 + env: + - name: POSTGRES_PASSWORD + value: "kub123" + - name: POSTGRES_USER + value: "kubenews" + - name: POSTGRES_DB + value: "kubenews" +--- +apiVersion: v1 +kind: Service +metadata: + name: postgre +spec: + selector: + app: postgre + ports: + - port: 5432 + targetPort: 5432 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kubenews +spec: + selector: + matchLabels: + app: kubenews + template: + metadata: + labels: + app: kubenews + spec: + containers: + - name: kubenews + image: lucasdantas123/kube-new:v1 + env: + - name: DB_DATABASE + value: "kubenews" + - name: DB_USERNAME + value: "kubenews" + - name: DB_PASSWORD + value: "kub123" + - name: DB_HOST + value: "postgre" +--- +apiVersion: v1 +kind: Services +metadata: + name: kube-news +spec: + selector: + app: kubenews + ports: + - port: 80 + targetPort: 8080 + modePort: 30000 + type: NodePort \ No newline at end of file From ca924e92a80ae67cf31e5cd6c6d08c894e2fa418 Mon Sep 17 00:00:00 2001 From: LucasDantasifce <46503@tjce.jus.br> Date: Thu, 4 Aug 2022 22:23:27 -0300 Subject: [PATCH 2/7] Adiconado manifestto e dockerFile --- src/.dockerignore | 1 + src/Dockerfile | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 src/.dockerignore create mode 100644 src/Dockerfile diff --git a/src/.dockerignore b/src/.dockerignore new file mode 100644 index 000000000..40b878db5 --- /dev/null +++ b/src/.dockerignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 000000000..d5d4c83cd --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,7 @@ +FROM node:16.15.0 +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 8080 +CMD ["node","server.js"] \ No newline at end of file From c87f30cbb2a1268fe3690fd6ac5f29c665499ba6 Mon Sep 17 00:00:00 2001 From: LucasDantasifce <47417163+LucasDantasifce@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:52:15 -0300 Subject: [PATCH 3/7] Update deployment.yaml --- k8s/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 8c3a50187..feb53b2cc 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -72,5 +72,5 @@ spec: ports: - port: 80 targetPort: 8080 - modePort: 30000 - type: NodePort \ No newline at end of file + nodePort: 30000 + type: NodePort From 8b51c836bf3f46f174468b6483105e25ab957377 Mon Sep 17 00:00:00 2001 From: LucasDantasifce <46503@tjce.jus.br> Date: Thu, 4 Aug 2022 22:53:31 -0300 Subject: [PATCH 4/7] Ajustando --- k8s/deployment.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 8c3a50187..d109b4013 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -19,11 +19,11 @@ spec: - containerPort: 5432 env: - name: POSTGRES_PASSWORD - value: "kub123" + value: "Pg123" - name: POSTGRES_USER - value: "kubenews" + value: "kubedevnews" - name: POSTGRES_DB - value: "kubenews" + value: "kubedevnews" --- apiVersion: v1 kind: Service @@ -54,16 +54,16 @@ spec: image: lucasdantas123/kube-new:v1 env: - name: DB_DATABASE - value: "kubenews" + value: "kubedevnews" - name: DB_USERNAME - value: "kubenews" + value: "kubedevnews" - name: DB_PASSWORD - value: "kub123" + value: "Pg123" - name: DB_HOST value: "postgre" --- apiVersion: v1 -kind: Services +kind: Service metadata: name: kube-news spec: @@ -72,5 +72,5 @@ spec: ports: - port: 80 targetPort: 8080 - modePort: 30000 + nodePort: 30000 type: NodePort \ No newline at end of file From 22c480701ca3c879593cd89c3a8e3c305881b9bd Mon Sep 17 00:00:00 2001 From: LucasDantasifce <47417163+LucasDantasifce@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:58:24 -0300 Subject: [PATCH 5/7] Update deployment.yaml --- k8s/deployment.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index feb53b2cc..2ef2ae3e5 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -19,11 +19,11 @@ spec: - containerPort: 5432 env: - name: POSTGRES_PASSWORD - value: "kub123" + value: "Pg123" - name: POSTGRES_USER - value: "kubenews" + value: "kubedevnews" - name: POSTGRES_DB - value: "kubenews" + value: "kubedevnews" --- apiVersion: v1 kind: Service @@ -54,16 +54,16 @@ spec: image: lucasdantas123/kube-new:v1 env: - name: DB_DATABASE - value: "kubenews" + value: "kubedevnews" - name: DB_USERNAME - value: "kubenews" + value: "kubedevnews" - name: DB_PASSWORD - value: "kub123" + value: "Pg123" - name: DB_HOST value: "postgre" --- apiVersion: v1 -kind: Services +kind: Service metadata: name: kube-news spec: @@ -74,3 +74,5 @@ spec: targetPort: 8080 nodePort: 30000 type: NodePort + + From 493a3fe4b9e8e26a01dc524e1e9dbb425e6803fc Mon Sep 17 00:00:00 2001 From: LucasDantasifce <46503@tjce.jus.br> Date: Thu, 4 Aug 2022 23:09:25 -0300 Subject: [PATCH 6/7] Ajustando --- k8s/deployment.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index f0fb0793a..6a86fc074 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -10,7 +10,7 @@ spec: template: metadata: labels: - app: postgre + app: postgre spec: containers: - name: postgre @@ -73,13 +73,4 @@ spec: - port: 80 targetPort: 8080 nodePort: 30000 -<<<<<<< HEAD type: NodePort -<<<<<<< HEAD -======= - type: NodePort ->>>>>>> c87f30cbb2a1268fe3690fd6ac5f29c665499ba6 -======= - - ->>>>>>> 22c480701ca3c879593cd89c3a8e3c305881b9bd From c9e17cdc14145b0d615220ee6450cdfda4785f0d Mon Sep 17 00:00:00 2001 From: LucasDantasifce <46503@tjce.jus.br> Date: Fri, 5 Aug 2022 18:36:27 -0300 Subject: [PATCH 7/7] ajuste --- k8s/deployment.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 6a86fc074..3bcae0e81 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -19,11 +19,11 @@ spec: - containerPort: 5432 env: - name: POSTGRES_PASSWORD - value: "Pg123" + value: "kube#123" - name: POSTGRES_USER - value: "kubedevnews" + value: "kubenews" - name: POSTGRES_DB - value: "kubedevnews" + value: "kubenews" --- apiVersion: v1 kind: Service @@ -58,9 +58,9 @@ spec: - name: DB_USERNAME value: "kubedevnews" - name: DB_PASSWORD - value: "Pg123" + value: "Pg#123" - name: DB_HOST - value: "postgre" + value: "localhost" --- apiVersion: v1 kind: Service