update deployment configs to use unprivledged nginx
This commit is contained in:
6
12-deploying-containers/Makefile
Normal file
6
12-deploying-containers/Makefile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
### Build + Push Images
|
||||||
|
.PHONY: build-push
|
||||||
|
build-push:
|
||||||
|
cd ../06-building-container-images/client-react && N=5 $(MAKE) build-N && N=5 $(MAKE) push-N
|
||||||
|
cd ../06-building-container-images/api-node && N=9 $(MAKE) build-N && N=9 $(MAKE) push-N
|
||||||
|
cd ../06-building-container-images/api-golang && N=8 $(MAKE) build-N && N=8 $(MAKE) push-N
|
||||||
@ -25,6 +25,10 @@ swarm-init:
|
|||||||
swarm-deploy-stack:
|
swarm-deploy-stack:
|
||||||
DOCKER_HOST=${DOCKER_HOST} docker stack deploy -c docker-swarm.yml example-app
|
DOCKER_HOST=${DOCKER_HOST} docker stack deploy -c docker-swarm.yml example-app
|
||||||
|
|
||||||
|
.PHONY: swarm-ls
|
||||||
|
swarm-ls:
|
||||||
|
DOCKER_HOST=${DOCKER_HOST} docker service ls
|
||||||
|
|
||||||
.PHONY: swarm-remove-stack
|
.PHONY: swarm-remove-stack
|
||||||
swarm-remove-stack:
|
swarm-remove-stack:
|
||||||
DOCKER_HOST=${DOCKER_HOST} docker stack rm example-app
|
DOCKER_HOST=${DOCKER_HOST} docker stack rm example-app
|
||||||
|
|||||||
@ -6,16 +6,16 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- frontend
|
- frontend
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:8080
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost/ping"]
|
test: ["CMD", "curl", "-f", "http://localhost:8080/ping"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
api-node:
|
api-node:
|
||||||
image: sidpalas/devops-directive-docker-course-api-node:8
|
image: sidpalas/devops-directive-docker-course-api-node:9
|
||||||
read_only: true
|
read_only: true
|
||||||
networks:
|
networks:
|
||||||
- frontend
|
- frontend
|
||||||
@ -35,7 +35,7 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
api-golang:
|
api-golang:
|
||||||
image: sidpalas/devops-directive-docker-course-api-golang:7
|
image: sidpalas/devops-directive-docker-course-api-golang:8
|
||||||
read_only: true
|
read_only: true
|
||||||
networks:
|
networks:
|
||||||
- frontend
|
- frontend
|
||||||
|
|||||||
@ -11,15 +11,15 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- frontend
|
- frontend
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:8080
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost/ping"]
|
test: ["CMD", "curl", "-f", "http://localhost:8080/ping"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
api-node:
|
api-node:
|
||||||
image: sidpalas/devops-directive-docker-course-api-node:8
|
image: sidpalas/devops-directive-docker-course-api-node:9
|
||||||
read_only: true
|
read_only: true
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@ -42,7 +42,7 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
api-golang:
|
api-golang:
|
||||||
image: sidpalas/devops-directive-docker-course-api-golang:7
|
image: sidpalas/devops-directive-docker-course-api-golang:8
|
||||||
read_only: true
|
read_only: true
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
|
|||||||
@ -28,7 +28,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: api-golang
|
- name: api-golang
|
||||||
image: sidpalas/devops-directive-docker-course-api-golang:7
|
image: sidpalas/devops-directive-docker-course-api-golang:8
|
||||||
env:
|
env:
|
||||||
- name: PORT
|
- name: PORT
|
||||||
value: "8080"
|
value: "8080"
|
||||||
|
|||||||
@ -28,7 +28,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: api-node
|
- name: api-node
|
||||||
image: sidpalas/devops-directive-docker-course-api-node:8
|
image: sidpalas/devops-directive-docker-course-api-node:9
|
||||||
env:
|
env:
|
||||||
- name: PORT
|
- name: PORT
|
||||||
value: "3000"
|
value: "3000"
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: client-react-nginx
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: client-react-nginx
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -17,14 +29,15 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- image: sidpalas/devops-directive-docker-course-client-react-nginx:5
|
- image: sidpalas/devops-directive-docker-course-client-react-nginx:5
|
||||||
name: client-react-nginx
|
name: client-react-nginx
|
||||||
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /ping
|
path: /ping
|
||||||
port: 80
|
port: 8080
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
@ -53,7 +66,7 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
default.conf: |-
|
default.conf: |-
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 8080;
|
||||||
|
|
||||||
location /ping {
|
location /ping {
|
||||||
access_log off;
|
access_log off;
|
||||||
|
|||||||
@ -12,7 +12,7 @@ spec:
|
|||||||
- kind: Service
|
- kind: Service
|
||||||
name: client-react-nginx
|
name: client-react-nginx
|
||||||
namespace: default
|
namespace: default
|
||||||
port: 80
|
port: 8080
|
||||||
scheme: http
|
scheme: http
|
||||||
- kind: Rule
|
- kind: Rule
|
||||||
match: Host(`docker-course-kubernetes.devopsdirective.com`) && PathPrefix(`/api/node`)
|
match: Host(`docker-course-kubernetes.devopsdirective.com`) && PathPrefix(`/api/node`)
|
||||||
|
|||||||
Reference in New Issue
Block a user