1、微服务执行计划
apiVersion: apps/v1 kind: Deployment metadata: name: microservice-howear-gateway namespace: microservice-test labels: app: microservice-howear-gateway spec: replicas: 1 revisionHistoryLimit: 1 selector: matchLabels: app: microservice-howear-gateway template: metadata: labels: app: microservice-howear-gateway spec: containers: - name: microservice-howear-gateway-test image: docker.iwhop.cn/weike-test/microservice-howear-gateway:9d667720 env: - name: TZ value: Asia/Shanghai ports: - name: http containerPort: 20000 protocol: TCP imagePullSecrets: - name: microservice-key
2、映射k8s内部端口到服务器端口
apiVersion: v1 kind: Service metadata: namespace: microservice-test labels: app: microservice-howear-gateway name: microservice-howear-gateway spec: ports: - port: 20000 protocol: TCP targetPort: 20000 selector: app: microservice-howear-gateway
其中的服务名称、端口、镜像等等自行替换!!!
标签:k8s,服务,name,app,test,microservice,执行,howear,gateway From: https://www.cnblogs.com/meiya/p/17111384.html