Kubernetes deployment solution across computer rooms
Since the business needs to be distributed in multiple data centers, it will be very inconvenient to split and switch traffic if you use one deployment deployment. Therefore, consider splitting the service by region.
1. Define the region of the server through node label, for example:
Kubectl label nodes vm101 region=bj
Kubectl label nodes vm102 region=sh
Kubectl label nodes vm103 region=mirror
For each region, a deployment and svc,deployment are deployed on the specified node through the label of node.
├── all.service.yaml-all node can get the endpoint list of gz/sh/mirror
├── gz
│ ├── deployment.yaml
│ └── service.yaml
├── ingress.yaml
├── mirror
│ ├── deployment.yaml
│ └── service.yaml
├── nginx.conf
├── php_conf.cm.yaml
└── sh
├── deployment.yaml
└── service.yaml