- 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.
- Java編程全能詞典
- Machine Learning for Cybersecurity Cookbook
- Excel 2007函數(shù)與公式自學(xué)寶典
- Hands-On Machine Learning on Google Cloud Platform
- Windows XP中文版應(yīng)用基礎(chǔ)
- 流處理器研究與設(shè)計(jì)
- 人工智能工程化:應(yīng)用落地與中臺(tái)構(gòu)建
- 最簡(jiǎn)數(shù)據(jù)挖掘
- 大數(shù)據(jù)安全與隱私保護(hù)
- Multimedia Programming with Pure Data
- STM32嵌入式微控制器快速上手
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 單片機(jī)技術(shù)一學(xué)就會(huì)
- Salesforce for Beginners
- Python文本分析