Skip to content

Instantly share code, notes, and snippets.

@runlevl4
Created January 4, 2020 18:08
Show Gist options
  • Save runlevl4/940edb9101238a20700063fca8481ba9 to your computer and use it in GitHub Desktop.
Save runlevl4/940edb9101238a20700063fca8481ba9 to your computer and use it in GitHub Desktop.
Describes how to easily create multiple Kubernetes resources
# Note: All examples have aliased kubectl to k --> alias k=kubectl
# Create a NGINX pod
k run nginx --image=nginx --restart=Never
# Create a NGINX deployment with 3 replicas
k run nginx --image=nginx --replicas=3
# Create a Job based on the busybox image. Execute the command "sleep 4800"
k run bb-job --image=busybox --restart=OnFailure -- /bin/sh -c "sleep 4800"
# Create a CronJob based on the busybox image. Write the date to stdout every minute.
k run bb-cj --image=busybox --restart=OnFailure --schedule="*/1 * * * *" -- date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment