Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions apps/config/mongo-api-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret

metadata:
name: acta-mongo-api-secrets

spec:
hostAPI: https://app.infisical.com/api
resyncInterval: 60

authentication:
universalAuth:
credentialsRef:
secretName: infisical-universal-auth
secretNamespace: acta-prod
secretsScope:
projectId: 051dcf5e-00ed-4d46-8b36-baad0a621f5d
envSlug: prod
secretsPath: /mongo-api
recursive: false

managedKubeSecretReferences:
- secretName: acta-mongo-api-env
secretNamespace: acta-prod
creationPolicy: Owner

template:
includeAllSecrets: false
data:
PORT: "{{ .PORT.Value }}"
MONGODB_URI: "{{ .MONGODB_URI.Value }}"
ACTA_PG_API_BASE_URL: "{{ .ACTA_PG_API_BASE_URL.Value }}"
ACTA_PG_API_CONNECT_TIMEOUT: "{{ .ACTA_PG_API_CONNECT_TIMEOUT.Value }}"
ACTA_PG_API_READ_TIMEOUT: "{{ .ACTA_PG_API_READ_TIMEOUT.Value }}"
4 changes: 3 additions & 1 deletion apps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ namespace: acta-prod

resources:
- pg-api.yaml
- config/pg-api-secrets.yaml
- mongo-api.yaml
- config/pg-api-secrets.yaml
- config/mongo-api-secrets.yaml
91 changes: 91 additions & 0 deletions apps/mongo-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apiVersion: apps/v1
kind: Deployment

metadata:
name: acta-mongo-api
annotations:
# reinicia os pods quando o infisical atualizar os secrets
secrets.infisical.com/auto-reload: "true"
labels:
app.kubernetes.io/name: acta-mongo-api
app.kubernetes.io/part-of: acta

spec:
replicas: 1
revisionHistoryLimit: 1

selector:
matchLabels:
app.kubernetes.io/name: acta-mongo-api

template:
metadata:
labels:
app.kubernetes.io/name: acta-mongo-api
app.kubernetes.io/part-of: acta

spec:
containers:
- name: acta-mongo-api
image: ghcr.io/appacta/acta-mongo-api:sha-695a7ddd23c317234cc0c3d447ecfdcb5504b3eb
imagePullPolicy: IfNotPresent

ports:
- name: http
containerPort: 8081
protocol: TCP

envFrom:
- secretRef:
name: acta-mongo-api-env

startupProbe:
tcpSocket:
port: http
periodSeconds: 10
failureThreshold: 60

readinessProbe:
httpGet:
path: /api/v1/health
port: http
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3

# verifica se o processo continua aceitando conexoes na porta
livenessProbe:
tcpSocket:
port: http
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 3

resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
---
apiVersion: v1
kind: Service

metadata:
name: acta-mongo-api
labels:
app.kubernetes.io/name: acta-mongo-api
app.kubernetes.io/part-of: acta

spec:
type: ClusterIP

selector:
app.kubernetes.io/name: acta-mongo-api

ports:
- name: http
port: 8081
targetPort: http
protocol: TCP
2 changes: 1 addition & 1 deletion apps/pg-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ spec:
- name: http
port: 8080
targetPort: http
protocol: TCP
protocol: TCP
Loading