Skip to content

Instantly share code, notes, and snippets.

@runlevl4
Created January 4, 2020 18:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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