iloom/k8s/20-muyu/system-rpc.yaml

73 lines
1.8 KiB
YAML
Raw Normal View History

apiVersion: v1
kind: Service
metadata:
name: muyu-system-rpc
namespace: iloom
spec:
type: ClusterIP
ports:
- port: 9001
targetPort: 9001
selector:
app: muyu-system-rpc
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: muyu-system-rpc
namespace: iloom
spec:
replicas: 1
selector:
matchLabels:
app: muyu-system-rpc
template:
metadata:
labels:
app: muyu-system-rpc
spec:
imagePullSecrets:
- name: harbor-pull-secret
initContainers:
- name: wait-mysql
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z mysql 3306; do sleep 2; done']
- name: wait-etcd
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z etcd 2379; do sleep 2; done']
- name: wait-redis
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z redis 6379; do sleep 2; done']
containers:
- name: system-rpc
image: harbor-in-k3s.cheverjohn.me/iloom/muyu-system-rpc:v1
ports:
- containerPort: 9001
env:
- name: TZ
value: Asia/Shanghai
volumeMounts:
- name: config
mountPath: /app/etc
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
tcpSocket:
port: 9001
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 9001
initialDelaySeconds: 20
periodSeconds: 30
volumes:
- name: config
configMap:
name: muyu-system-config