增加了k8s devops的配置

This commit is contained in:
bamanker
2023-11-23 14:54:22 +08:00
parent 773a759473
commit 70f55ef987

View File

@@ -2,16 +2,15 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
app: $APP_NAME app: dailylove
version: $TAG name: dailylove
name: $APP_NAME namespace: dl #一定要写名称空间
namespace: my-proj #一定要写名称空间
spec: spec:
progressDeadlineSeconds: 600 progressDeadlineSeconds: 600
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: $APP_NAME app: dailylove
strategy: strategy:
rollingUpdate: rollingUpdate:
maxSurge: 50% maxSurge: 50%
@@ -20,8 +19,7 @@ spec:
template: template:
metadata: metadata:
labels: labels:
app: $APP_NAME app: dailylove
version: $TAG
spec: spec:
imagePullSecrets: imagePullSecrets:
- name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码 - name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码
@@ -53,9 +51,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: labels:
app: $APP_NAME app: dailylove
version: $TAG name: dailylove
name: $APP_NAME
namespace: my-proj namespace: my-proj
spec: spec:
ports: ports:
@@ -64,14 +61,14 @@ spec:
protocol: TCP protocol: TCP
targetPort: 13146 targetPort: 13146
selector: selector:
app: $APP_NAME app: dailylove
sessionAffinity: None sessionAffinity: None
type: ClusterIP type: ClusterIP
--- ---
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: $APP_NAME # ServiceAccount的名字 name: dailylove # ServiceAccount的名字
namespace: my-proj # serviceaccount的namespace namespace: my-proj # serviceaccount的namespace
labels: labels:
app: $APP_NAME #ServiceAccount的标签 app: dailylove #ServiceAccount的标签