提交 6af96528 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 添加 Kubernetes 配置文件

上级 2ac4bab7
# Deployment yaml 配置
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: ${NAMESPACE}
name: ${APPNAME}
labels:
app: ${APPNAME}
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: ${APPNAME}
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: ${APPNAME}
spec:
nodeName: k8s-n-91
containers:
- command:
- ./start.sh
env:
- name: TZ
value: Asia/Shanghai
- name: timestamp
value: '${TIMESTAMP}'
image: '${IMAGE_VPC}'
imagePullPolicy: Always
name: ${APPNAME}
ports:
- containerPort: 2048
name: port01
protocol: TCP
resources:
limits:
cpu: 300m
memory: 512Mi
requests:
cpu: 300m
memory: 512Mi
stdin: true
volumeMounts:
- name: storage
mountPath: "/data2/logs/"
- name: volume-localtime
mountPath: /etc/localtime
imagePullSecrets:
- name: kube-node-lease-login-2022-11-21
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- name: storage
persistentVolumeClaim:
claimName: nas-com-web
- name: volume-localtime
hostPath:
path: /etc/localtime
type: ''
# Service yaml 配置
---
apiVersion: v1
kind: Service
metadata:
namespace: ${NAMESPACE}
name: ${APPNAME}-svc
spec:
ports:
- name: port01
port: 12048
protocol: TCP
targetPort: 2048
selector:
app: ${APPNAME}
type: ClusterIP
# Ingress yaml 配置
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: ${NAMESPACE}
name: ${APPNAME}-ingress
annotations:
nginx.ingress.kubernetes.io/service-weight: ''
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
# 指定 Ingress Controller 的类型
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: ${DOMAIN}.ezijing.com
http:
paths:
- backend:
service:
name: ${APPNAME}-svc
port:
number: 12048
path: /
pathType: ImplementationSpecific
- host: ${DOMAIN1}.ezijing.com
http:
paths:
- backend:
service:
name: ${APPNAME}-svc
port:
number: 12048
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- ${DOMAIN}.ezijing.com
secretName: kube-node-lease-ssl-2022-11-21
- hosts:
- ${DOMAIN1}.ezijing.com
secretName: kube-node-lease-ssl-2022-11-21
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论