feat: adicionar arquivos de configuração para ambiente Docker e Kubernetes
parent
0c65128844
commit
d3cdc14d67
|
|
@ -0,0 +1,26 @@
|
||||||
|
Created by https://www.toptal.com/developers/gitignore/api/maven
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=maven
|
||||||
|
|
||||||
|
### Maven ###
|
||||||
|
target/
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
# Eclipse m2e generated files
|
||||||
|
# Eclipse Core
|
||||||
|
.project
|
||||||
|
# JDT-specific (Eclipse Java Development Tools)
|
||||||
|
.classpath
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/maven
|
||||||
|
|
||||||
|
.idea
|
||||||
|
.env*
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"arrowParens": "always",
|
||||||
|
"tabWidth": 2,
|
||||||
|
"semi": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"useTabs": false
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /code
|
||||||
|
|
||||||
|
COPY package.json package.json
|
||||||
|
COPY package-lock.json package-lock.json
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
CMD [ "npm", "run", "dev" ]
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
@Library('jenkins-library') _
|
||||||
|
pipeline {
|
||||||
|
agent {label 'docker-slave'}
|
||||||
|
parameters {
|
||||||
|
string(name: 'PROJETO', defaultValue: 'agfrotapainelweb', description: 'Digite o nome do projeto:')
|
||||||
|
choice(name: 'AMBIENTE', choices: ['HML','BETA','PRD'], description: 'Selecione o Ambiente para publicação:')
|
||||||
|
string(name: 'TAG', defaultValue: '', description: 'Digite a tag da imagem caso deseje republicar uma versão já existente:')
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
DOCKERIMAGE = " "
|
||||||
|
MAIL_NOTIFICATION_RECIPIENTS = "rafael.deda@gmail.com"
|
||||||
|
}
|
||||||
|
stages{
|
||||||
|
stage('Build e Construção da Imagem') {
|
||||||
|
when {
|
||||||
|
environment name: 'TAG', value: ''
|
||||||
|
}
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
DOCKERIMAGE = buildImages(DOCKERIMAGE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Submeter Imagem ao Registry') {
|
||||||
|
when {
|
||||||
|
environment name: 'TAG', value: ''
|
||||||
|
}
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
DOCKERIMAGE = publishImages(DOCKERIMAGE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy no Ambiente Selecionado no Cluster') {
|
||||||
|
when {
|
||||||
|
anyOf {
|
||||||
|
environment name: 'AMBIENTE', value: 'BETA'
|
||||||
|
environment name: 'AMBIENTE', value: 'PRD'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
deployCluster()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy no Ambiente on Promise') {
|
||||||
|
when {
|
||||||
|
allOf {
|
||||||
|
environment name: 'AMBIENTE', value: 'HML'
|
||||||
|
environment name: 'ON_PROMISE', value: '1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps{
|
||||||
|
deployCluster('k8s-inovesolutions-hml')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// stage('Limpando Imagens') {
|
||||||
|
// agent {label 'conteiner'}
|
||||||
|
// steps{
|
||||||
|
// limpandoImagens()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
//sendNotification()
|
||||||
|
cleanWorkspace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
dnsNames:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
issuerRef:
|
||||||
|
group: cert-manager.io
|
||||||
|
kind: ClusterIssuer
|
||||||
|
name: letsencrypt-prod
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- PROJETO
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-role-credential-sc
|
||||||
|
optional: false
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1000Mi
|
||||||
|
requests:
|
||||||
|
memory: 780Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1200Mi
|
||||||
|
requests:
|
||||||
|
memory: 1000Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-hpa
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
maxReplicas: 1
|
||||||
|
metrics:
|
||||||
|
- resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
averageValue: 780Mi
|
||||||
|
type: AverageValue
|
||||||
|
type: Resource
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: traefik-http-to-https-redirectscheme@kubernetescrd,traefik-enable-cors-header@kubernetescrd
|
||||||
|
name: agapesistemas-PROJETO-ing
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie: 'true'
|
||||||
|
#traefik.ingress.kubernetes.io/service.sticky.cookie.name: JSESSIONID
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie.secure: 'true'
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: PROJETO
|
||||||
|
type: ClusterIP
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
dnsNames:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
issuerRef:
|
||||||
|
group: cert-manager.io
|
||||||
|
kind: ClusterIssuer
|
||||||
|
name: letsencrypt-prod
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- PROJETO
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-role-credential-sc
|
||||||
|
optional: false
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 857Mi
|
||||||
|
requests:
|
||||||
|
memory: 720Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1800Mi
|
||||||
|
requests:
|
||||||
|
memory: 1008Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-hpa
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
maxReplicas: 1
|
||||||
|
metrics:
|
||||||
|
- resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
averageValue: 720Mi
|
||||||
|
type: AverageValue
|
||||||
|
type: Resource
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: traefik-http-to-https-redirectscheme@kubernetescrd,traefik-enable-cors-header@kubernetescrd
|
||||||
|
name: agapesistemas-PROJETO-ing
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie: 'true'
|
||||||
|
#traefik.ingress.kubernetes.io/service.sticky.cookie.name: JSESSIONID
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie.secure: 'true'
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: PROJETO
|
||||||
|
type: ClusterIP
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
||||||
|
data:
|
||||||
|
VITE_API_URL: 'https://agpainelapi.hml.agapesistemas.com.br'
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
dnsNames:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
issuerRef:
|
||||||
|
group: cert-manager.io
|
||||||
|
kind: ClusterIssuer
|
||||||
|
name: letsencrypt-prod
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- PROJETO
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 7142Mi
|
||||||
|
requests:
|
||||||
|
memory: 6000Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE-high
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- PROJETO
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-role-credential-sc
|
||||||
|
optional: false
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1000Mi
|
||||||
|
requests:
|
||||||
|
memory: 780Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: PROJETO
|
||||||
|
workload.user.cattle.io/workloadselector: apps.deployment-agapesistemas-ns-AMBIENTE-PROJETO
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: TZ
|
||||||
|
value: America/Maceio
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-db-credential-sc
|
||||||
|
- secretRef:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
- configMapRef:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
image: IMAGEM:TAG
|
||||||
|
name: PROJETO
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1200Mi
|
||||||
|
requests:
|
||||||
|
memory: 1000Mi
|
||||||
|
nodeSelector:
|
||||||
|
doks.digitalocean.com/node-pool: pool-k8s-agapesistemas-app-AMBIENTE
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-agapesistemas
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-hpa
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
maxReplicas: 3
|
||||||
|
metrics:
|
||||||
|
- resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
averageValue: 6000Mi
|
||||||
|
type: AverageValue
|
||||||
|
type: Resource
|
||||||
|
minReplicas: 2
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-hpa
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
maxReplicas: 1
|
||||||
|
metrics:
|
||||||
|
- resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
averageValue: 780Mi
|
||||||
|
type: AverageValue
|
||||||
|
type: Resource
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: PROJETO-dp-AMBIENTE
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: traefik-http-to-https-redirectscheme@kubernetescrd,traefik-enable-cors-header@kubernetescrd
|
||||||
|
name: agapesistemas-PROJETO-ing
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- PROJETOAMBIENTE.agapesistemas.com.br
|
||||||
|
secretName: agapesistemas-PROJETOAMBIENTE-tls
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie: 'true'
|
||||||
|
#traefik.ingress.kubernetes.io/service.sticky.cookie.name: JSESSIONID
|
||||||
|
traefik.ingress.kubernetes.io/service.sticky.cookie.secure: 'true'
|
||||||
|
name: agapesistemas-PROJETO-svc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: PROJETO
|
||||||
|
type: ClusterIP
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-cm
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
||||||
|
data:
|
||||||
|
VITE_API_URL: 'https://agpainelapiprd.agapesistemas.com.br'
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: agapesistemas-PROJETO-sc
|
||||||
|
namespace: agapesistemas-ns-AMBIENTE
|
||||||
Loading…
Reference in New Issue