This commit is contained in:
parent
be656900c0
commit
c1a0a477d8
@ -54,11 +54,10 @@ jobs:
|
|||||||
chmod +x kubectl
|
chmod +x kubectl
|
||||||
mv kubectl /usr/local/bin/
|
mv kubectl /usr/local/bin/
|
||||||
|
|
||||||
- name: Deploy to K3s
|
- name: Deploy to Volcengine VKE
|
||||||
uses: Azure/k8s-set-context@v3
|
run: |
|
||||||
with:
|
mkdir -p ~/.kube
|
||||||
method: kubeconfig
|
echo "${{ secrets.KUBE_CONFIG_VKE }}" > ~/.kube/config
|
||||||
kubeconfig: ${{ secrets.KUBE_CONFIG }}
|
|
||||||
|
|
||||||
- name: Create or Update Secrets
|
- name: Create or Update Secrets
|
||||||
run: |
|
run: |
|
||||||
@ -79,9 +78,15 @@ jobs:
|
|||||||
sed -i "s|\${CI_REGISTRY_IMAGE}/video-backend:latest|${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/video-backend:latest|g" k8s/backend-deployment.yaml
|
sed -i "s|\${CI_REGISTRY_IMAGE}/video-backend:latest|${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/video-backend:latest|g" k8s/backend-deployment.yaml
|
||||||
sed -i "s|\${CI_REGISTRY_IMAGE}/video-web:latest|${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/video-web:latest|g" k8s/web-deployment.yaml
|
sed -i "s|\${CI_REGISTRY_IMAGE}/video-web:latest|${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/video-web:latest|g" k8s/web-deployment.yaml
|
||||||
|
|
||||||
|
# Install cert-manager (skip if already installed)
|
||||||
|
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.1/cert-manager.yaml 2>/dev/null || true
|
||||||
|
# Wait for cert-manager to be ready
|
||||||
|
kubectl -n cert-manager wait --for=condition=Available deployment/cert-manager-webhook --timeout=120s 2>/dev/null || true
|
||||||
|
|
||||||
# Apply all manifests
|
# Apply all manifests
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
{
|
{
|
||||||
|
kubectl apply -f k8s/cert-manager-issuer.yaml
|
||||||
kubectl apply -f k8s/backend-deployment.yaml
|
kubectl apply -f k8s/backend-deployment.yaml
|
||||||
kubectl apply -f k8s/web-deployment.yaml
|
kubectl apply -f k8s/web-deployment.yaml
|
||||||
kubectl apply -f k8s/ingress.yaml
|
kubectl apply -f k8s/ingress.yaml
|
||||||
|
|||||||
@ -13,6 +13,8 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: video-backend
|
app: video-backend
|
||||||
|
annotations:
|
||||||
|
vke.volcengine.com/burst-to-vci: "enforce"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: video-backend
|
- name: video-backend
|
||||||
|
|||||||
15
k8s/cert-manager-issuer.yaml
Normal file
15
k8s/cert-manager-issuer.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# ClusterIssuer for Let's Encrypt automatic certificate generation & renewal
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: ClusterIssuer
|
||||||
|
metadata:
|
||||||
|
name: letsencrypt-prod
|
||||||
|
spec:
|
||||||
|
acme:
|
||||||
|
server: https://acme-v02.api.letsencrypt.org/directory
|
||||||
|
email: airlabsv001@gmail.com
|
||||||
|
privateKeySecretRef:
|
||||||
|
name: letsencrypt-prod-key
|
||||||
|
solvers:
|
||||||
|
- http01:
|
||||||
|
ingress:
|
||||||
|
class: alb
|
||||||
@ -3,16 +3,16 @@ kind: Ingress
|
|||||||
metadata:
|
metadata:
|
||||||
name: video-huoshan-ingress
|
name: video-huoshan-ingress
|
||||||
annotations:
|
annotations:
|
||||||
kubernetes.io/ingress.class: "traefik"
|
kubernetes.io/ingress.class: "alb"
|
||||||
|
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||||
|
alb.ingress.kubernetes.io/ssl-redirect: "true"
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
spec:
|
spec:
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- video-huoshan-api.airlabs.art
|
- video-huoshan-api.airlabs.art
|
||||||
secretName: video-huoshan-api-tls
|
|
||||||
- hosts:
|
|
||||||
- video-huoshan-web.airlabs.art
|
- video-huoshan-web.airlabs.art
|
||||||
secretName: video-huoshan-web-tls
|
secretName: video-huoshan-tls
|
||||||
rules:
|
rules:
|
||||||
- host: video-huoshan-api.airlabs.art
|
- host: video-huoshan-api.airlabs.art
|
||||||
http:
|
http:
|
||||||
|
|||||||
@ -13,6 +13,8 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: video-web
|
app: video-web
|
||||||
|
annotations:
|
||||||
|
vke.volcengine.com/burst-to-vci: "enforce"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: video-web
|
- name: video-web
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user