grpc容器部署k8s
kubectl create ns nginx kubectl label nodes cn-hangzhou.1xxxxxxx.211 type=test5 apiVersion: apps/v1 kind: Deployment metadata: name: grpc-testv2 namespace: nginx spec: replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app: grpc-testv2 template: metadata: labels: name: grpc-testv2 app: grpc-testv2 version: v1 spec: terminationGracePeriodSeconds: 10 containers: - name: grpc-testv2 image: opcache/busybox:grpcv3 ports: - containerPort: 50051 nodeSelector: type: test5 --- apiVersion: v1 kind: Service metadata: name: grpc-testv2 namespace: nginx spec: type: NodePort ports: - name: grpc-testv2 port: 50051 protocol: TCP nodePort: 31222 sessionAffinity: None selector: app: grpc-testv2
grpcclientv2
apiVersion: apps/v1 kind: Deployment metadata: name: grpcclientv3 namespace: nginx spec: replicas: 15 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app: grpcclientv3 template: metadata: labels: name: grpcclientv3 app: grpcclientv3 version: v1 spec: terminationGracePeriodSeconds: 10 containers: - name: grpcclientv3 image: opcache/busybox:grpcclientv2 ports: - containerPort: 50051 resources: limits: cpu: 1000m memory: 3000Mi requests: cpu: 600m memory: 1000Mi nodeSelector: type: test5 --- apiVersion: v1 kind: Service metadata: name: grpcclientv3 namespace: nginx spec: type: NodePort ports: - name: grpcclientv3 port: 50051 protocol: TCP nodePort: 31226 sessionAffinity: None selector: app: grpcclientv3
请登录之后再进行评论