feat: add deployment, service, and ingress for app3
- Create deployment configuration for app3 with 5 replicas. - Add service to expose app3 on port 3002. - Define ingress resource for handling external traffic to app3. - Set up TLS and host configuration for secure traffic. This commit introduces the necessary Kubernetes manifests for the new app3 which allows for deployment, service exposure, and ingress routing, thereby enabling it to be accessed securely over the specified domain. The deployment includes node affinity rules to restrict execution environments and enhances the overall service availability.
This commit is contained in:
parent
48164c12da
commit
33832c5761
26
cgs/cgs3/ingress.yaml
Normal file
26
cgs/cgs3/ingress.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: app3
|
||||||
|
namespace: cgs
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "cf-cluster-issuer"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- cgs3.skybyte.me
|
||||||
|
secretName: cgs3-skybyte-me-tls
|
||||||
|
rules:
|
||||||
|
- host: cgs3.skybyte.me
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: app3
|
||||||
|
port:
|
||||||
|
name: web
|
||||||
|
|
51
cgs/cgs3/load.yaml
Normal file
51
cgs/cgs3/load.yaml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: app3
|
||||||
|
namespace: cgs
|
||||||
|
labels:
|
||||||
|
app: cgs3
|
||||||
|
spec:
|
||||||
|
replicas: 5
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cgs3
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations: {}
|
||||||
|
labels:
|
||||||
|
app: cgs3
|
||||||
|
spec:
|
||||||
|
#nodeSelector:
|
||||||
|
# region: us
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: region
|
||||||
|
operator: NotIn
|
||||||
|
values:
|
||||||
|
- cn
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: NotIn
|
||||||
|
values:
|
||||||
|
- claw-hk2
|
||||||
|
containers:
|
||||||
|
- name: app3
|
||||||
|
image: songtianlun/chatgpt-web:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 3002
|
||||||
|
name: web
|
||||||
|
env:
|
||||||
|
- name: OPENAI_API_BASE_URL
|
||||||
|
value: "https://www.gptapi.us"
|
||||||
|
- name: OPENAI_API_KEY
|
||||||
|
value: "sk-ctwJWUefglo8FVeY54A7FeDe86834e728e0cCc3c0f5071D0"
|
||||||
|
- name: OPENAI_API_MODEL
|
||||||
|
value: " o1-mini"
|
||||||
|
- name: TZ
|
||||||
|
value: "Asia/Shanghai"
|
||||||
|
|
||||||
|
|
12
cgs/cgs3/service.yaml
Normal file
12
cgs/cgs3/service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: app3
|
||||||
|
namespace: cgs
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: cgs3
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
port: 3002
|
||||||
|
targetPort: 3002
|
Loading…
Reference in New Issue
Block a user