官术网_书友最值得收藏!

Configuration and deployment in Kubernetes

Kubernetes is a container orchestrator—it is the technology that most embodies IaC, in my opinion, because the way it deploys containers, the network architecture (load balancer, ports, and so on), and the volume management, as well as the protection of sensitive information, are described completely in the YAML specification files.

Here is a simple example of a YAML specification file:

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-demo
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80

We can see in the preceding specification file, the name of the image to deploy (ngnix), the port to open (80), and the number of replicas (2).

The Kubernetes part will be discussed in detail in Chapter 8, Managing Containers Effectively with Kubernetes.
主站蜘蛛池模板: 双流县| 三台县| 齐齐哈尔市| 闸北区| 乌兰县| 梧州市| 安丘市| 灵丘县| 错那县| 光山县| 土默特左旗| 阿瓦提县| 英德市| 娄烦县| 广德县| 敦煌市| 乌拉特后旗| 建水县| 文水县| 云梦县| 宝鸡市| 湄潭县| 宣恩县| 大方县| 乌兰县| 沙田区| 大连市| 垣曲县| 东明县| 镇雄县| 中西区| 彰武县| 晋中市| 上犹县| 罗山县| 敦化市| 瑞金市| 龙门县| 苍梧县| 清流县| 满城县|