4.2 KiB
4.2 KiB
title | reviewers | content_template | |
---|---|---|---|
使用 SC 安装服务目录 |
|
templates/task |
{{% capture overview %}} {{< glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" >}}
使用服务目录安装程序工具可以轻松地在 Kubernetes 集群上安装或卸载服务目录。
这个 CLI 工具以 sc
命令形式被安装在您的本地环境中。
{{% /capture %}}
{{% capture prerequisites %}}
-
了解服务目录的主要概念。
-
安装 Go 1.6+ 以及设置
GOPATH
。 -
安装生成 SSL 工件所需的 cfssl 工具。
-
服务目录需要 Kubernetes 1.7+ 版本。
-
安装和设置 kubectl,以便将其配置为连接到 Kubernetes v1.7+ 集群。
-
要安装服务目录,kubectl 用户必须绑定到 cluster-admin 角色。为了确保这是正确的,请运行以下命令:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<user-name>
{{% /capture %}}
{{% capture steps %}}
在本地环境中安装 sc
使用 go get
命令安装 sc
CLI 工具:
go get github.com/GoogleCloudPlatform/k8s-service-catalog/installer/cmd/sc
执行上述命令后,sc
应被安装在 GOPATH/bin
目录中了。
在 Kubernetes 集群中安装服务目录
首先,检查是否已经安装了所有依赖项。运行:
sc check
如检查通过,应输出:
Dependency check passed. You are good to go.
接下来,运行安装命令并指定要用于备份的 storageclass
:
sc install --etcd-backup-storageclass "standard"
卸载服务目录
如果您想使用 sc
工具从 Kubernetes 集群卸载服务目录,请运行:
sc uninstall
{{% /capture %}}
{{% capture whatsnext %}}
- 查看 服务代理示例。
- 探索 kubernetes-incubator/service-catalog 项目。
{{% /capture %}}