Files
links/k8s/deployment.yaml
T
2024-09-08 23:15:40 +10:00

112 lines
2.5 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: links-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: nfs-client
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: links
labels:
tags.datadoghq.com/env: "prod"
tags.datadoghq.com/service: "links"
spec:
selector:
matchLabels:
app: links
replicas: 1
template:
metadata:
labels:
app: links
tags.datadoghq.com/env: "prod"
tags.datadoghq.com/service: "links"
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: links-pvc
containers:
- name: links
image: "ghcr.io/wahyd4/links:main"
securityContext:
runAsUser: 1000
imagePullPolicy: Always
volumeMounts:
- name: data
mountPath: /app/data
env:
- name: DB_HOST
value: new-postgres-postgresql.db.svc.cluster.local
- name: DB_NAME
value: badges
- name: DB_USERNAME
value: postgres
# - name: DB_PASSWORD
# valueFrom:
# { secretKeyRef: { name: database-credentials, key: password } }
ports:
- containerPort: 8000
name: links-port
protocol: TCP
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 200m
memory: 512Mi
imagePullSecrets:
- name: github-image-pull-secret
---
apiVersion: v1
kind: Service
metadata:
name: links
labels:
app: links
spec:
type: ClusterIP
ports:
- port: 80
targetPort: links-port
protocol: TCP
name: web
selector:
app: links
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: links-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.cc/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.cc/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
spec:
tls:
- hosts:
- to.junv.cc
secretName: links-tls
rules:
- host: to.junv.cc
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: links
port:
number: 80