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
20 changes: 20 additions & 0 deletions deploy/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: profanity-filter
namespace: argocd
spec:
project: profanity
source:
repoURL: https://github.com/Whale0928/profanity-filter-api
path: deploy/overlays/production
targetRevision: deploy
destination:
server: https://kubernetes.default.svc
namespace: profanity-production
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
69 changes: 69 additions & 0 deletions deploy/overlays/production/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: profanity-api
namespace: profanity-production
labels:
app: profanity-api
environment: production
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: profanity-api
template:
metadata:
labels:
app: profanity-api
environment: production
spec:
imagePullSecrets:
- name: ghcr-secret
nodeSelector:
kubernetes.io/arch: arm64
containers:
- name: profanity-api
image: ghcr.io/whale0928/profanity-api:deploy-877aa7d
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: SERVER_PORT
value: "8080"
- name: ACTUATOR_PATH
value: "/health"
- name: SPRING_PROFILES_ACTIVE
value: "prod"
envFrom:
- secretRef:
name: profanity-secrets
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "250m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 90
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
18 changes: 18 additions & 0 deletions deploy/overlays/production/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: profanity-secrets
namespace: profanity-production
spec:
refreshInterval: 1h
secretStoreRef:
name: onepassword-store
kind: SecretStore
target:
name: profanity-secrets
creationPolicy: Owner
dataFrom:
- extract:
key: secret-source
- extract:
key: database-source
9 changes: 9 additions & 0 deletions deploy/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: profanity-production

resources:
- resources.yaml
- deployment.yaml
- external-secret.yaml
72 changes: 72 additions & 0 deletions deploy/overlays/production/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: v1
kind: Namespace
metadata:
name: profanity-production
labels:
app: profanity-api
environment: production
---
apiVersion: v1
kind: Service
metadata:
name: profanity-api
namespace: profanity-production
labels:
app: profanity-api
environment: production
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8080
protocol: TCP
selector:
app: profanity-api
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: profanity-api
namespace: profanity-production
labels:
app: profanity-api
environment: production
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- api.profanity.kr-filter.com
secretName: profanity-api-tls
rules:
- host: api.profanity.kr-filter.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: profanity-api
port:
number: 80
---
apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
name: onepassword-store
namespace: profanity-production
spec:
provider:
onepassword:
connectHost: http://onepassword-connect.external-secrets-system.svc.cluster.local:8080
vaults:
profanity-filter: 1
auth:
secretRef:
connectTokenSecretRef:
name: op-token
key: token
2 changes: 1 addition & 1 deletion module.secrets
Loading
Loading