CI-CD dejo node
This commit is contained in:
28
infrastructure/kubernetes/dev/app/health-probes.yml
Normal file
28
infrastructure/kubernetes/dev/app/health-probes.yml
Normal file
@ -0,0 +1,28 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dejo-node
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: deje-node
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health/liveness
|
||||
port: 8080
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health/readiness
|
||||
port: 8080
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /health/startup
|
||||
port: 8080
|
||||
failureThreshold: 30
|
||||
periodSeconds: 10
|
||||
|
||||
10
infrastructure/kubernetes/dev/app/image-tag.yml
Normal file
10
infrastructure/kubernetes/dev/app/image-tag.yml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dejo-node
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: dejo-node
|
||||
image: 859024677525.dkr.ecr.us-east-1.amazonaws.com/dev-dejo/dejo-node:latest
|
||||
19
infrastructure/kubernetes/dev/app/ingress.yml
Normal file
19
infrastructure/kubernetes/dev/app/ingress.yml
Normal file
@ -0,0 +1,19 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: dejo-node-ingress
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
||||
spec:
|
||||
rules:
|
||||
- host: dev-dejo-node.dejo.digital
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: dejo-node-svc
|
||||
port:
|
||||
number: 8545
|
||||
|
||||
8
infrastructure/kubernetes/dev/base/app/configmap.yml
Normal file
8
infrastructure/kubernetes/dev/base/app/configmap.yml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: dejo-node-config
|
||||
data:
|
||||
# ex.: configuração genérica, se precisar
|
||||
LOG_LEVEL: "info"
|
||||
|
||||
33
infrastructure/kubernetes/dev/base/app/deployment.yml
Normal file
33
infrastructure/kubernetes/dev/base/app/deployment.yml
Normal file
@ -0,0 +1,33 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dejo-node
|
||||
labels:
|
||||
app: dejo-node
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: dejo-node
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: dejo-node
|
||||
spec:
|
||||
containers:
|
||||
- name: dejo-node
|
||||
image: dejo/node:latest
|
||||
ports:
|
||||
- containerPort: 8545
|
||||
- containerPort: 30303
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: dejo-node-config
|
||||
volumeMounts:
|
||||
- name: blockchain-storage
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: blockchain-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: dejo-node-pvc
|
||||
|
||||
19
infrastructure/kubernetes/dev/base/app/hpa.yml
Normal file
19
infrastructure/kubernetes/dev/base/app/hpa.yml
Normal file
@ -0,0 +1,19 @@
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: dejo-node-hpa
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: dejo-node
|
||||
minReplicas: 2
|
||||
maxReplicas: 10
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: 70
|
||||
|
||||
8
infrastructure/kubernetes/dev/base/app/ingress.yml
Normal file
8
infrastructure/kubernetes/dev/base/app/ingress.yml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: dejo-node-ingress
|
||||
labels:
|
||||
app: dejo-node
|
||||
spec: {}
|
||||
|
||||
13
infrastructure/kubernetes/dev/base/app/pvc.yml
Normal file
13
infrastructure/kubernetes/dev/base/app/pvc.yml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: dejo-node-pvc
|
||||
labels:
|
||||
app: dejo-node
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: gp3
|
||||
|
||||
18
infrastructure/kubernetes/dev/base/app/service.yml
Normal file
18
infrastructure/kubernetes/dev/base/app/service.yml
Normal file
@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: dejo-node-svc
|
||||
labels:
|
||||
app: dejo-node
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: dejo-node
|
||||
ports:
|
||||
- name: rpc
|
||||
port: 8545
|
||||
targetPort: 8545
|
||||
- name: p2p
|
||||
port: 30303
|
||||
targetPort: 30303
|
||||
|
||||
13
infrastructure/kubernetes/dev/base/kustomization.yml
Normal file
13
infrastructure/kubernetes/dev/base/kustomization.yml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ./app/deployment.yml
|
||||
- ./app/service.yml
|
||||
- ./app/pvc.yml
|
||||
- ./app/configmap.yml
|
||||
# - ./app/hpa.yml
|
||||
- ./app/ingress.yml
|
||||
|
||||
commonLabels:
|
||||
app: dejo-node
|
||||
15
infrastructure/kubernetes/dev/kustomization.yml
Normal file
15
infrastructure/kubernetes/dev/kustomization.yml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: dejo-node
|
||||
resources:
|
||||
- base
|
||||
|
||||
patchesStrategicMerge:
|
||||
# se você precisar alterar só a imagem, replicas, ingress, etc:
|
||||
- app/image-tag.yml
|
||||
- app/ingress.yml
|
||||
- app/health-probes.yml
|
||||
commonLabels:
|
||||
env: dev
|
||||
|
||||
Reference in New Issue
Block a user