apiVersion: v1 kind: Service metadata: name: muyu-inventory-rpc namespace: iloom spec: type: ClusterIP ports: - port: 9002 targetPort: 9002 selector: app: muyu-inventory-rpc --- apiVersion: apps/v1 kind: Deployment metadata: name: muyu-inventory-rpc namespace: iloom spec: replicas: 1 selector: matchLabels: app: muyu-inventory-rpc template: metadata: labels: app: muyu-inventory-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: inventory-rpc image: harbor-in-k3s.cheverjohn.me/iloom/muyu-inventory-rpc:v1 ports: - containerPort: 9002 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: 9002 initialDelaySeconds: 10 periodSeconds: 10 livenessProbe: tcpSocket: port: 9002 initialDelaySeconds: 20 periodSeconds: 30 volumes: - name: config configMap: name: muyu-inventory-config