Commit c06631a0 authored by root's avatar root

add deploy to other nodes

parent ba5de87c
Pipeline #1144 passed with stage
in 3 minutes and 7 seconds
...@@ -5,7 +5,7 @@ stages: ...@@ -5,7 +5,7 @@ stages:
- deploy_to_test - deploy_to_test
- run_tests - run_tests
- deploy_node_to_prod - deploy_node_to_prod
- deploy_seed_to_prod - deploy_other_nodes_to_prod
build_dev: build_dev:
stage: build_dev stage: build_dev
...@@ -100,3 +100,27 @@ deploy_node_to_prod: ...@@ -100,3 +100,27 @@ deploy_node_to_prod:
- release - release
tags: tags:
- buidl1-shell - buidl1-shell
deploy_other_nodes_to_prod:
stage: deploy_other_nodes_to_prod
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- sed 's|_IMAGE_NAME_|'"${CI_REGISTRY_IMAGE}/prod"'|g; s|_VERSION_|'"${CI_PIPELINE_ID}"'|g' app-dst-client.tpl.yml > app-dst-client.yml; cat app-dst-client.yml
- sed 's|_IMAGE_NAME_|'"${CI_REGISTRY_IMAGE}/prod"'|g; s|_VERSION_|'"${CI_PIPELINE_ID}"'|g' app-nako-scanner.tpl.yml > app-nako-scanner.yml; cat app-nako-scanner.yml
- wget https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl && chmod +x ./kubectl
- wget https://github.com/garethr/kubeval/releases/download/0.7.3/kubeval-linux-amd64.tar.gz && tar xvf kubeval-linux-amd64.tar.gz && ./kubeval app.yml
- ./kubectl apply -f app.yml
- ./kubectl apply -f app-dst-client.yml
- ./kubectl apply -f app-nako-scanner.yml
environment:
name: ${CI_COMMIT_REF_NAME}
url: https://xvideos.com
only:
- test
tags:
- buidl1-dind
...@@ -2,39 +2,45 @@ ...@@ -2,39 +2,45 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: seed1 name: dst-client
labels: labels:
app: seed1 app: dst-client
namespace: prod namespace: prod
spec: spec:
replicas: 3 replicas: 1
revisionHistoryLimit: 2 revisionHistoryLimit: 1
strategy: strategy:
type: Recreate type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector: selector:
matchLabels: matchLabels:
app: seed app: dst-client
template: template:
metadata: metadata:
labels: labels:
app: seed app: dst-client
spec: spec:
containers: containers:
- name: seed1 - name: dst-client
image: _IMAGE_NAME_:_VERSION_ image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"] command: ["dotnet"]
args: ["DeStream.DeStreamD.dll"] args: ["DeStream.DeStreamD.dll"]
ports: ports:
- name: seed-api - name: dst-client
containerPort: 56833 containerPort: 5000
- name: seed-svc
containerPort: 56864
volumeMounts: volumeMounts:
- name: pv-seed1 - name: pv-dst-client
mountPath: "/root/.destreamnode" mountPath: /root/.destreamnode/destream/DeStreamMain
imagePullSecrets: - name: dst-client-config
- name: registrypullsecret mountPath: /root/.destreamnode/destream/DeStreamMain/destream.conf
subPath: destream.conf
nodeName: node3
volumes: volumes:
- name: pv-seed1 - name: pv-dst-client
persistentVolumeClaim: persistentVolumeClaim:
claimName: pv-seed1-claim claimName: pv-dst-client-claim
\ No newline at end of file - name: dst-client-config
configMap:
name: destreamconf
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-scanner
labels:
app: node-scanner
namespace: prod
spec:
replicas: 1
revisionHistoryLimit: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: node-scanner
template:
metadata:
labels:
app: node-scanner
spec:
containers:
- name: node-scanner
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","IpRangeFiltering=false"]
ports:
- name: node-scanner
containerPort: 5000
volumeMounts:
- name: pv-node-scanner-prod
mountPath: /root/.destreamnode/destream/DeStreamMain
- name: node-scanner-config
mountPath: /root/.destreamnode/destream/DeStreamMain/destream.conf
subPath: destream.conf
nodeName: node1
volumes:
- name: pv-node-scanner-prod
persistentVolumeClaim:
claimName: pv-node-scanner-prod-claim
- name: node-scanner-config
configMap:
name: nakonodeconf
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node1
labels:
app: node1
namespace: prod1
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node1
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node1
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node1
persistentVolumeClaim:
claimName: pv-node1-claim
\ No newline at end of file
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node2
labels:
app: node2
namespace: prod2
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node2
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node2
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node2
persistentVolumeClaim:
claimName: pv-node2-claim
\ No newline at end of file
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node3
labels:
app: node3
namespace: prod3
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node3
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node3
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node3
persistentVolumeClaim:
claimName: pv-node3-claim
\ No newline at end of file
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node4
labels:
app: node4
namespace: prod4
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node4
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node4
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node4
persistentVolumeClaim:
claimName: pv-node4-claim
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node5
labels:
app: node5
namespace: prod5
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node5
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node5
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node5
persistentVolumeClaim:
claimName: pv-node5-claim
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node6
labels:
app: node6
namespace: prod6
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node6
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node6
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node6
persistentVolumeClaim:
claimName: pv-node6-claim
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node7
labels:
app: node7
namespace: prod7
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node7
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node7
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node7
persistentVolumeClaim:
claimName: pv-node7-claim
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node8
labels:
app: node8
namespace: prod8
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node8
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node8
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node8
persistentVolumeClaim:
claimName: pv-node8-claim
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node9
labels:
app: node9
namespace: prod9
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node9
image: _IMAGE_NAME_:_VERSION_
command: ["dotnet"]
args: ["DeStream.DeStreamD.dll","-addnode=148.251.53.215","-addnode=144.76.219.71"]
ports:
- name: node-api
containerPort: 56833
- name: node-svc
containerPort: 56864
volumeMounts:
- name: pv-node9
mountPath: "/root/.destreamnode"
imagePullSecrets:
- name: registrypullsecret
volumes:
- name: pv-node9
persistentVolumeClaim:
claimName: pv-node9-claim
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment