- 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.
- 過(guò)程控制工程及仿真
- Canvas LMS Course Design
- 輕松學(xué)C#
- 基于LabWindows/CVI的虛擬儀器設(shè)計(jì)與應(yīng)用
- 教父母學(xué)會(huì)上網(wǎng)
- 大數(shù)據(jù)平臺(tái)異常檢測(cè)分析系統(tǒng)的若干關(guān)鍵技術(shù)研究
- Lightning Fast Animation in Element 3D
- Excel 2007技巧大全
- 菜鳥(niǎo)起飛系統(tǒng)安裝與重裝
- 網(wǎng)絡(luò)安全技術(shù)及應(yīng)用
- 大數(shù)據(jù)素質(zhì)讀本
- 筆記本電腦使用與維護(hù)
- 傳感技術(shù)基礎(chǔ)與技能實(shí)訓(xùn)
- 單片機(jī)與微機(jī)原理及應(yīng)用
- AI成“神”之日:人工智能的終極演變