apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: opssvr-deployment
namespace: ops-prod
spec:
selector:
matchLabels:
app: opssvr
replicas: 2
revisionHistoryLimit: 5
template:
metadata:
labels:
app: opssvr
spec:
containers:
- env:
- name: ENABLE_CRON_JOBS
value: "false"
- name: RELEASE_ENV
value: "product"
- name: SVR_PORT
value: "80"
name: opssvr
image: registry.cn-hangzhou.aliyuncs.com/ich-sre/ops_svr:v-21515
imagePullPolicy: IfNotPresent
command: ["./fulu_ops_service"]
args: ["run", "--cron=$(ENABLE_CRON_JOBS)", "--env=$(RELEASE_ENV)", "--port=$(SVR_PORT)"]
resources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 0.05
memory: 256Mi
livenessProbe:
httpGet:
path: /hc
port: 80
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 30
timeoutSeconds: 1
ports:
- containerPort: 80
protocol: TCP
imagePullSecrets:
- name: ich-sre
restartPolicy: Always
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
revisionHistoryLimit: 10
progressDeadlineSeconds: 600
---
apiVersion: v1
kind: Service
metadata:
name: opssvr-service
namespace: ops-prod
spec:
selector:
app: opssvr
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: opssvr-ingress
namespace: ops-prod
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: ops.com
http:
paths:
- backend:
serviceName: opssvr-service
servicePort: 80
path: /api(/|$)(.*)
tls:
- hosts:
- ops.com
secretName: ops.com-godaddy-merge-ssl
标签:ingress,name,ops,部署,opssvr,80,k8,yml,metadata
From: https://www.cnblogs.com/guanchaoguo/p/17577939.html