mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-18 12:29:18 +00:00
Update kubectl run to kubectl create deploy
This commit is contained in:
@@ -352,7 +352,7 @@ We demonstrated *update* and *watch* semantics.
|
||||
|
||||
- That's where the actual logic of Kubernetes lives
|
||||
|
||||
- When we create a Deployment (e.g. with `kubectl run web --image=nginx`),
|
||||
- When we create a Deployment (e.g. with `kubectl create deployment web --image=nginx`),
|
||||
|
||||
- we create a Deployment object
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
- Our goal is to build a minimal cluster allowing us to:
|
||||
|
||||
- create a Deployment (with `kubectl run` or `kubectl create deployment`)
|
||||
- create a Deployment (with `kubectl create deployment`)
|
||||
- expose it with a Service
|
||||
- connect to that service
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ Note: we don't need to specify `--validate=false` here.
|
||||
|
||||
## Advantage of YAML
|
||||
|
||||
- Using YAML (instead of `kubectl run`/`create`/etc.) allows to be *declarative*
|
||||
- Using YAML (instead of `kubectl create <kind>`) allows to be *declarative*
|
||||
|
||||
- The YAML describes the desired state of our cluster and applications
|
||||
|
||||
@@ -194,7 +194,7 @@ Note: we don't need to specify `--validate=false` here.
|
||||
|
||||
## YAML in practice
|
||||
|
||||
- Get started with `kubectl run`/`create`/`expose`/etc.
|
||||
- Get started with `kubectl create deployment` and `kubectl expose`
|
||||
|
||||
- Dump the YAML with `kubectl get -o yaml`
|
||||
|
||||
|
||||
@@ -151,9 +151,9 @@
|
||||
|
||||
## Creating a deployment for our HTTP server
|
||||
|
||||
- We *could* do `kubectl run httpenv --image=jpetazzo/httpenv` ...
|
||||
- We will create a deployment with `kubectl create deployment`
|
||||
|
||||
- But since `kubectl run` is being deprecated, let's see how to use `kubectl create` instead
|
||||
- Then we will scale it with `kubectl scale`
|
||||
|
||||
.exercise[
|
||||
|
||||
|
||||
@@ -132,15 +132,15 @@ Exactly what we need!
|
||||
|
||||
- Everything created with `kubectl run` has a label `run`
|
||||
|
||||
- We can use that property to view the logs of all the pods created with `kubectl run`
|
||||
- Everything created with `kubectl create deployment` has a label `app`
|
||||
|
||||
- Similarly, everything created with `kubectl create deployment` has a label `app`
|
||||
- We can use that property to view the logs of all the pods created with `kubectl create deployment`
|
||||
|
||||
.exercise[
|
||||
|
||||
- View the logs for all the things started with `kubectl run`:
|
||||
- View the logs for all the things started with `kubectl create deployment`:
|
||||
```bash
|
||||
stern -l run
|
||||
stern -l app
|
||||
```
|
||||
|
||||
<!--
|
||||
|
||||
@@ -570,7 +570,7 @@ After the Kibana UI loads, we need to click around a bit
|
||||
|
||||
## Deploying our apps with operators
|
||||
|
||||
- It is very simple to deploy with `kubectl run` / `kubectl expose`
|
||||
- It is very simple to deploy with `kubectl create deployment` / `kubectl expose`
|
||||
|
||||
- We can unlock more features by writing YAML and using `kubectl apply`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user