加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
krm.yaml 4.62 KB
一键复制 编辑 原始数据 按行查看 历史
杜宽 提交于 2024-03-02 09:38 . update krm.yaml.
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: krm
spec: {}
status: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
name: krm-backend
namespace: krm
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
creationTimestamp: null
name: krm-backend
namespace: krm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: edit
subjects:
- kind: ServiceAccount
name: krm-backend
namespace: krm
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: namespace-creater
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
creationTimestamp: null
name: krm-backend-ns-creater
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: namespace-creater
subjects:
- kind: ServiceAccount
name: krm-backend
namespace: krm
---
apiVersion: v1
kind: Service
metadata:
labels:
app: krm-backend
name: krm-backend
namespace: krm
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: krm-backend
sessionAffinity: None
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: krm-backend
name: krm-backend
namespace: krm
spec:
replicas: 1
selector:
matchLabels:
app: krm-backend
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: krm-backend
spec:
serviceAccountName: krm-backend
containers:
- env:
- name: TZ
value: Asia/Shanghai
- name: LANG
value: C.UTF-8
- name: GIN_MODE
value: release
- name: LOG_LEVEL
value: info
- name: USERNAME
value: 21232F297A57A5A743894A0E4A801FC3
- name: PASSWORD
value: 21232F297A57A5A743894A0E4A801FC3
- name: "IN_CLUSTER"
value: "true"
image: registry.cn-beijing.aliyuncs.com/dotbalo/krm-backend:latest
lifecycle: {}
livenessProbe:
failureThreshold: 2
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 8080
timeoutSeconds: 2
name: krm-backend
ports:
- containerPort: 8080
name: web
protocol: TCP
readinessProbe:
failureThreshold: 2
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 8080
timeoutSeconds: 2
resources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 200m
memory: 256Mi
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: krm-frontend
name: krm-frontend
namespace: krm
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: krm-frontend
sessionAffinity: None
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: krm-frontend
name: krm-frontend
namespace: krm
spec:
replicas: 1
selector:
matchLabels:
app: krm-frontend
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: krm-frontend
spec:
containers:
- env:
- name: TZ
value: Asia/Shanghai
- name: LANG
value: C.UTF-8
image: registry.cn-beijing.aliyuncs.com/dotbalo/krm-frontend:latest
lifecycle: {}
livenessProbe:
failureThreshold: 2
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
name: krm-backend
ports:
- containerPort: 80
name: web
protocol: TCP
readinessProbe:
failureThreshold: 2
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
resources:
limits:
cpu: 1
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
restartPolicy: Always
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化