kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" Create a cron job with a command kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date Create a cron job with the specified name. Usage $ kubectl create cronjob NAME --image=...
「Annotation」、「Pod」、「Deployment」、「Job」、「CronJob」,并在实践中加深对知识的理解。
configmap Create a config map from a local file, directory or literal value cronjob Create a cron job with the specified name deployment Create a deployment with the specified name ingress Create an ingress with the specified name job Create a job with the specified name namespace Create a nam...
$ kubectl create deployment my-nginx--image=nginx deployment.apps/my-nginx created 1. 2. 使用以下命令创建新的 cronjob 的另一个示例: 复制 $ kubectl create job my-cronjob--schedule="*/5 * * * *"--image=busybox--command--args="echo This is a cron job!" 1. 命令参数: --schedule ...
BasicCommands(Beginner):create Create a resource from a file or from stdin.expose 使用 replication controller,service,deployment 或者 pod 并暴露它作为一个 新的 Kubernetes Service run 在集群中运行一个指定的镜像set为 objects 设置一个指定的特征 ...
kubectl create kubectl create namespace kubectl create pod kubectl create deployment kubectl create configmap kubectl create quota kubectl create secret kubectl create job/cronjob kubectl create serviceaccount kubectl create rolebinding/role/clusterrolebinding/clusterrole kubectl exec kubectl apply kubectl replac...
kubectlgetsecretmysecret2-ojsonpath='{.data.username}{"\n"}'|base64-d 1. 2. 3. 4. 5. 6. 7. 8. kubectl create job/cronjob #创建一个job kubectlcreatejobpi--image=perl--perl-Mbignum=bpi-wle'print bpi(2000)' kubectlcreatejobbusybox--image=busybox--dry-run=client-oyaml--/...
kubectl create job -n [namespace] --from=cronjob/[cron-job-name] [job-name] 使用Secret Secret 用于在 Kubernetes 中安全地存储敏感信息,如密码、OAuth 令牌和 SSH 密钥。 # Create Secret kubectl create secret generic [secret-name] --from-literal=key1=value1 --from-file=ssh-privatekey=~/.ss...
使用Job 作业管理 pod 的执行以执行特定任务,并确保在终止之前成功完成该任务。 复制 # Run a CronJob manuallykubectlcreatejob[job-name]--image=image/name# Creates a new job from the job template specified in the cronjobkubectlcreatejob-n[namespace]--from=cronjob/[cron-job-name] [job-name] ...
kubectl create job -n [namespace] --from=cronjob/[cron-job-name] [job-name] Working with secrets 处理秘密 Secrets are used to store sensitive information like passwords, OAuth tokens, and SSH keys securely in Kubernetes. 机密用于在 Kubernetes 中安全地存储密码、OAuth 令牌和 SSH 密钥等敏感信息...