Skip to content

Instantly share code, notes, and snippets.

@peco8
Last active November 19, 2019 09:13
Show Gist options
  • Save peco8/95d6bd7a701d50a4f7a3a8b92eccc79f to your computer and use it in GitHub Desktop.
Save peco8/95d6bd7a701d50a4f7a3a8b92eccc79f to your computer and use it in GitHub Desktop.
# kubectl create
(...)
Available Commands:
clusterrole Create a ClusterRole.
clusterrolebinding Create a ClusterRoleBinding for a particular ClusterRole
configmap Create a configmap from a local file, directory or literal value
deployment Create a deployment with the specified name.
job Create a job with the specified name.
namespace Create a namespace with the specified name
poddisruptionbudget Create a pod disruption budget with the specified name.
priorityclass Create a priorityclass with the specified name.
quota Create a quota with the specified name.
role Create a role with single rule.
rolebinding Create a RoleBinding for a particular Role or ClusterRole
secret Create a secret using specified subcommand
service Create a service using specified subcommand.
serviceaccount Create a service account with the specified name
# deployment
kubectl create deployment test --image test -o yaml --dry-run
# pod (# --restart=Never => pod)
kubectl run test --restart=Never --image test -o yaml --dry-run
# job
kubectl create job test --image test -o yaml --dry-run
# cronjob
# ref. https://stackoverflow.com/questions/57545304/create-resource-cronjob-boilerplate-with-kubectl
kubectl run test --schedule "* * * * *" --image test -o yaml --dry-run
# service
kubectl create service clusterip test --tcp 80 -o yaml --dry-run
# configmap
kubectl create cm test --from-literal test=test -o yaml --dry-run
# secrets
kubectl create secret generic test --from-literal test=test -o yaml --dry-run
# serviceaccount
kubectl create serviceaccount test -o yaml --dry-run
# clusterrolebinding
kubectl create clusterrolebinding myclusterrolebinding --clusterrole=edit --serviceaccount default:mysc -o yaml --dry-run
# rolebinding
kubectl create rolebinding cluster-admin-binding --clusterrole=edit --serviceaccount default:mysc -o yaml --dry-run
# poddisruptionbudget
kubectl create pdb my-pdb --selector=app=nginx --min-available=1 -o yaml --dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment