codecamp

Kubernetes 使用SC安装服务目录

使用 SC 安装服务目录

服务目录(Service Catalog)是 服务目录是一种扩展 API,它能让 Kubernetes 集群中运行的应用易于使用外部托管的的软件服务,例如云供应商提供的数据仓库服务。

服务目录可以检索、供应、和绑定由 服务代理人(Service Brokers) 提供的外部托管服务(Managed Services), 而无需知道那些服务具体是怎样创建和托管的。

使用 GCP 服务目录安装程序 工具可以轻松地在 Kubernetes 集群上安装或卸载服务目录,并将其链接到 Google Cloud 项目。

服务目录不仅可以与 Google Cloud 一起使用,还可以与任何类型的托管服务一起使用。

在开始之前

  • 了解服务目录 的主要概念。
  • 安装 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>
    

在本地环境中安装 sc

安装程序在你的本地计算机上以 CLI 工具的形式运行,名为 ​sc​。

使用 ​go get​ 安装:

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


Kubernetes 使用Helm安装Service Catalog
Kubernetes 使用HostAliases向Pod /etc/hosts文件添加条目
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Kubernetes 管理集群

Kubernetes Service

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }