- Kubernetes for Serverless Applications
- Russ McKendrick
- 183字
- 2021-07-02 19:16:47
Deployments
One thing you may be thinking you will be able to do with a ReplicaSet is rolling upgrades and rollbacks. Unfortunately, ReplicaSets can only replicate the same version of a pod; luckily, this is where deployments come in.
A deployment controller is designed to update a ReplicaSet or pod. Lets use NGINX as an example. As you can see from the following definition, we have 3 replicas all running NGINX version 1.9.14:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.14
ports:
- containerPort: 80
kubectl is the command-line client for Kubernetes; we will be looking at this in more detail in our next chapter.
We could deploy this using the following command:
$ kubectl create -f nginx-deployment.yaml
Now say we want to update the version of the NGINX image used. We simply need to run the following command:
$ kubectl set image deployment/nginx-deployment nginx=nginx:1.13.5 deployment "nginx-deployment" image updated
This will update each pod in turn until all of the pods are running the new version of NGINX.
- 大學計算機信息技術導論
- Hands-On Intelligent Agents with OpenAI Gym
- Mastering Proxmox(Third Edition)
- 工業機器人技術及應用
- 精通Windows Vista必讀
- Expert AWS Development
- 流處理器研究與設計
- Visual C++編程全能詞典
- INSTANT Autodesk Revit 2013 Customization with .NET How-to
- 完全掌握AutoCAD 2008中文版:機械篇
- JSP從入門到精通
- 網絡布線與小型局域網搭建
- Hadoop應用開發基礎
- 智能生產線的重構方法
- Applied Data Visualization with R and ggplot2