From 26c4bfbe4c110daab8600f0e75a9d07fc56ded75 Mon Sep 17 00:00:00 2001 From: Wilfried OLLIVIER Date: Sat, 21 Nov 2020 17:53:43 +0100 Subject: [PATCH] Add k8s commands --- src/ops/k8s/kubectl.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ops/k8s/kubectl.md b/src/ops/k8s/kubectl.md index 154a7e4..1fad4be 100644 --- a/src/ops/k8s/kubectl.md +++ b/src/ops/k8s/kubectl.md @@ -18,6 +18,24 @@ Even if you see `kubectl apply` everywhere sometimes it's handy to use dedicated For example, `kubectl create` is used to create a ressource and will throw an error if a ressource already exists. +#### Imperative commands quick reference + +Do not forget that `--dry-run=client` can be usefull + +##### Create a simple pod + +```sh +kubectl run nginx --image=nginx +``` + +##### Create a deployement + +```sh +kubectl create deployment --image=nginx nginx +``` + +**Gotcha**, deployement do not have a `--replicas` option, you need to use `kubctl scale` after deployement creation + ### Generating a manifests, blazzing fast way ```sh