docs: add kubernetes and workflow documentation
Some checks failed
Deploy NestJS API / build-and-push-deploy (push) Failing after 8s
Some checks failed
Deploy NestJS API / build-and-push-deploy (push) Failing after 8s
This commit is contained in:
10
k8s/base/configmap.yaml
Normal file
10
k8s/base/configmap.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: vendaweb-api-config
|
||||
data:
|
||||
REDIS_HOST: '172.35.0.250'
|
||||
REDIS_PORT: '6379'
|
||||
DB_HOST: '172.35.0.250'
|
||||
DB_PORT: '1521'
|
||||
DB_SERVICE_NAME: 'ORCL'
|
||||
62
k8s/base/deployment.yaml
Normal file
62
k8s/base/deployment.yaml
Normal file
@@ -0,0 +1,62 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: vendaweb-api
|
||||
labels:
|
||||
app: vendaweb-api
|
||||
spec:
|
||||
replicas: 15
|
||||
selector:
|
||||
matchLabels:
|
||||
app: vendaweb-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: vendaweb-api
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: harbor-secret
|
||||
containers:
|
||||
- name: api
|
||||
image: 172.35.0.216/library/vendaweb-api:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8065
|
||||
protocol: TCP
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: vendaweb-api-config
|
||||
- secretRef:
|
||||
name: vendaweb-api-secrets
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 6
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 6
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 24
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
7
k8s/base/kustomization.yaml
Normal file
7
k8s/base/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- configmap.yaml
|
||||
8
k8s/base/secret.yaml
Normal file
8
k8s/base/secret.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: vendaweb-api-secrets
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_USERNAME: 'simplifique'
|
||||
DB_PASSWORD: 'simplifique'
|
||||
15
k8s/base/service.yaml
Normal file
15
k8s/base/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: vendaweb-api
|
||||
labels:
|
||||
app: vendaweb-api
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: vendaweb-api
|
||||
ports:
|
||||
- name: http
|
||||
port: 8065
|
||||
targetPort: 8065
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user