From 2f1ad67fb32636e0fb331f7f88766d772e3a695c Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 28 Sep 2018 20:54:11 -0500 Subject: [PATCH 1/2] Add explanation about the kubectl run deprecation warning --- slides/k8s/kubectlrun.md | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/slides/k8s/kubectlrun.md b/slides/k8s/kubectlrun.md index b082b866..b842ad6b 100644 --- a/slides/k8s/kubectlrun.md +++ b/slides/k8s/kubectlrun.md @@ -32,7 +32,8 @@ -- -OK, what just happened? +(Starting with Kubernetes 1.12, we get a message telling us that +`kubectl run` is deprecated. Let's ignore it for now.) --- @@ -228,6 +229,44 @@ We could! But the *deployment* would notice it right away, and scale back to the --- +## What about that deprecation warning? + +- As we can see from the previous slide, `kubectl run` can do many things + +- The exact type of resource created is not obvious + +- To make things more explicit, it is better to use `kubectl create`: + + - `kubectl create deployment` to create a deployment + + - `kubectl create job` to create a job + +- Eventually, `kubectl run` will be used only to start one-shot pods + + (see https://github.com/kubernetes/kubernetes/pull/68132) + +--- + +## Various ways of creating resources + +- `kubectl run` + + - easy way to get started + - versatile + +- `kubectl create ` + + - explicit, but lacks some features + - can't create a CronJob + - can't pass command-line arguments to deployments + +- `kubectl create -f foo.yaml` or `kubectl apply -f foo.yaml` + + - all features are available + - requires to write YAML + +--- + ## Viewing logs of multiple pods - When we specify a deployment name, only one single pod's logs are shown From 0a942118c1d4ca45ad0fe0e18a14c54465bd1d25 Mon Sep 17 00:00:00 2001 From: Bridget Kromhout Date: Fri, 28 Sep 2018 21:32:23 -0500 Subject: [PATCH 2/2] Update kubectlrun.md slight wording change --- slides/k8s/kubectlrun.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slides/k8s/kubectlrun.md b/slides/k8s/kubectlrun.md index b842ad6b..ee142a76 100644 --- a/slides/k8s/kubectlrun.md +++ b/slides/k8s/kubectlrun.md @@ -263,7 +263,7 @@ We could! But the *deployment* would notice it right away, and scale back to the - `kubectl create -f foo.yaml` or `kubectl apply -f foo.yaml` - all features are available - - requires to write YAML + - requires writing YAML ---