diff --git a/docs/book/src/cronjob-tutorial/running.md b/docs/book/src/cronjob-tutorial/running.md index 0b1dbde3c05..dd61d8638fc 100644 --- a/docs/book/src/cronjob-tutorial/running.md +++ b/docs/book/src/cronjob-tutorial/running.md @@ -1,45 +1,32 @@ -# Running and deploying the controller +# 运行和部署 controller -To test out the controller, we can run it locally against the cluster. -Before we do so, though, we'll need to install our CRDs, as per the [quick -start](/quick-start.md). This will automatically update the YAML -manifests using controller-tools, if needed: +要测试 controller,我们可以在集群本地运行它。不过,在开始之前,我们需要按照 [快速入门](/quick-start.md) 安装 CRD。如果需要,将使用 controller-tools 自动更新 YAML 清单: ```bash make install ``` -Now that we've installed our CRDs, we can run the controller against our -cluster. This will use whatever credentials that we connect to the -cluster with, so we don't need to worry about RBAC just yet. +现在我们已经安装了 CRD,在集群上运行 controller 了。这将使用与集群连接所用的任何凭据,因此我们现在不必担心 RBAC。 -In a separate terminal, run +在单独的终端中运行 ```bash make run ENABLE_WEBHOOKS=false ``` -You should see logs from the controller about starting up, but it won't do -anything just yet. +您应该会看到 controller 关于启动的日志,但它还没有做任何事情。 -At this point, we need a CronJob to test with. Let's write a sample to -`config/samples/batch_v1_cronjob.yaml`, and use that: +此时,我们需要一个 CronJob 进行测试。让我们写一个样例到 `config/samples/batch_v1_cronjob.yaml`,并使用: ```yaml {{#include ./testdata/project/config/samples/batch_v1_cronjob.yaml}} @@ -49,21 +36,18 @@ At this point, we need a CronJob to test with. Let's write a sample to kubectl create -f config/samples/batch_v1_cronjob.yaml ``` -At this point, you should see a flurry of activity. If you watch the -changes, you should see your cronjob running, and updating status: +此时,您应该看到一系列的活动。如果看到变更,则应该看到您的 cronjob 正在运行,并且正在更新状态: ```bash kubectl get cronjob.batch.tutorial.kubebuilder.io -o yaml kubectl get job ``` -Now that we know it's working, we can run it in the cluster. Stop the -`make run` invocation, and run +现在我们知道它正在工作,我们可以在集群中运行它。停止 `make run` 调用,然后运行 ```bash make docker-build docker-push IMG=/:tag make deploy IMG=/:tag ``` -If we list cronjobs again like we did before, we should see the controller -functioning again! +如果像以前一样再次列出 cronjobs,我们应该会看到控制器再次运行!