mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
Update k8s deployment yaml
This commit is contained in:
@@ -52,7 +52,6 @@ jobs:
|
||||
sed -i 's|image: .*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}|' k8s/deployment.yaml
|
||||
|
||||
# Apply Kubernetes manifests
|
||||
kubectl apply -f k8s/deployment.yaml
|
||||
kubectl apply -f k8s/service.yaml
|
||||
kubectl apply -n apps -f k8s/deployment.yaml
|
||||
env:
|
||||
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
|
||||
|
||||
+83
-9
@@ -1,20 +1,94 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: url-manager
|
||||
namespace: default
|
||||
name: links
|
||||
labels:
|
||||
tags.datadoghq.com/env: "prod"
|
||||
tags.datadoghq.com/service: "links"
|
||||
tags.datadoghq.com/version: "{{IMAGE_VERSION}}"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: url-manager
|
||||
app: links
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: url-manager
|
||||
app: links
|
||||
tags.datadoghq.com/env: "prod"
|
||||
tags.datadoghq.com/service: "links"
|
||||
tags.datadoghq.com/version: "{{IMAGE_VERSION}}"
|
||||
spec:
|
||||
containers:
|
||||
- name: url-manager
|
||||
image: ghcr.io/yourgithubusername/url-manager:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
- name: links
|
||||
image: "ghcr.io/wahyd4/links:main"
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
imagePullPolicy: Always
|
||||
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
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: url-manager
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: url-manager
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 8000
|
||||
type: ClusterIP
|
||||
Reference in New Issue
Block a user