mirror of
https://github.com/wahyd4/say-it-backend.git
synced 2026-08-08 21:07:38 +10:00
100 lines
2.1 KiB
YAML
100 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: say-it
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: say-it
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: say-it
|
|
spec:
|
|
containers:
|
|
- name: say-it
|
|
image: "docker.pkg.github.com/wahyd4/say-it-backend/say-it:{{IMAGE_VERSION}}"
|
|
securityContext:
|
|
runAsUser: 1000
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: CLIENT_ID
|
|
valueFrom:
|
|
{ secretKeyRef: { name: say-it-credentials, key: clientId } }
|
|
- name: CLIENT_SECRET
|
|
valueFrom:
|
|
{ secretKeyRef: { name: say-it-credentials, key: clientSecret } }
|
|
ports:
|
|
- containerPort: 8080
|
|
name: say-it-port
|
|
protocol: TCP
|
|
resources:
|
|
requests:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
limits:
|
|
cpu: 50m
|
|
memory: 128Mi
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: say-it
|
|
labels:
|
|
app: say-it
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: say-it-port
|
|
protocol: TCP
|
|
name: web
|
|
selector:
|
|
app: say-it
|
|
|
|
---
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
kind: Ingress
|
|
metadata:
|
|
name: say-it-ingress
|
|
annotations:
|
|
kubernetes.io/ingress.class: "nginx"
|
|
kubernetes.io/tls-acme: "true"
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
spec:
|
|
tls:
|
|
- hosts:
|
|
- say-it.home.toozhao.com
|
|
secretName: say-it-tls
|
|
rules:
|
|
- host: say-it.home.toozhao.com
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
serviceName: say-it
|
|
servicePort: 80
|
|
|
|
# ---
|
|
# apiVersion: monitoring.coreos.com/v1
|
|
# kind: ServiceMonitor
|
|
# metadata:
|
|
# name: say-it
|
|
# labels:
|
|
# app: say-it
|
|
# release: prometheus # this can make the service monitor be discovered by prometheus
|
|
# spec:
|
|
# namespaceSelector:
|
|
# matchNames:
|
|
# - apps
|
|
# selector:
|
|
# matchLabels:
|
|
# app: say-it
|
|
# endpoints:
|
|
# - port: metrics-port
|
|
# interval: 30s
|