From fee0be7f0964be499a4015535a897c52ed56c07b Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Wed, 2 Sep 2020 16:48:19 +0200 Subject: [PATCH] Update 'kubectl create deployment' for 1.19 --- slides/k8s/batch-jobs.md | 4 ---- slides/k8s/kubectl-run.md | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/slides/k8s/batch-jobs.md b/slides/k8s/batch-jobs.md index c8b765ed..569cfd6e 100644 --- a/slides/k8s/batch-jobs.md +++ b/slides/k8s/batch-jobs.md @@ -176,12 +176,8 @@ class: extra-details - can't express parallelism or completions of Jobs - - can't express Pods with multiple containers - - can't express healthchecks, resource limits - - etc. - - `kubectl create` and `kubectl run` are *helpers* that generate YAML manifests - If we write these manifests ourselves, we can use all features and options diff --git a/slides/k8s/kubectl-run.md b/slides/k8s/kubectl-run.md index 7f1ce849..8991cbc0 100644 --- a/slides/k8s/kubectl-run.md +++ b/slides/k8s/kubectl-run.md @@ -296,7 +296,7 @@ class: extra-details - When using `kubectl create deployment`, we cannot indicate the command to execute - (at least, not in Kubernetes 1.18) + (at least, not in Kubernetes 1.18; but that changed in Kubernetes 1.19) - We can: @@ -344,6 +344,19 @@ class: extra-details --- +class: extra-details + +## In Kubernetes 1.19 + +- Since Kubernetes 1.19, we can specify the command to run + +- The command must be passed after two dashes: + ```bash + kubectl create deployment pingpong --image=alpine -- ping 127.1 + ``` + +--- + ## Viewing container output - Let's use the `kubectl logs` command