title | layout |
---|---|
Install |
docwithnav |
Starting from version 0.3.x, Service Catalog uses Admission Webhooks
to manage custom resources. It uses Additional Printer Columns
so you can use kubectl
to interact with Service Catalog.
The rest of this document details how to:
- Set up Service Catalog on your cluster
- Interact with the Service Catalog API
Service Catalog requires a Kubernetes cluster v1.13 or later. You'll also need a
Kubernetes configuration file
installed on your host. You need this file so you can use kubectl
and
helm
to communicate with the cluster. Many Kubernetes installation
tools and/or cloud providers will set this configuration file up for you. Please
check with your tool or provider for details.
Most interaction with the service catalog system is achieved through the
kubectl
command line interface. As with the cluster version, Service Catalog
requires kubectl
version 1.13 or newer.
First, check your version of kubectl
:
kubectl version
Ensure that the server version and client versions are both 1.13
or above.
If you need to upgrade your client, follow the
installation instructions
to get a new kubectl
binary.
For example, run the following command to get an up-to-date binary on Mac OS:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
chmod +x ./kubectl
You'll need a Kubernetes installation with in-cluster DNS enabled. Most popular installation methods will automatically configure in-cluster DNS for you:
- Minikube
hack/local-up-cluster.sh
(in the Kubernetes repository)- Most cloud providers
Service Catalog uses CRDs to store information.
You'll install Service Catalog with Helm, and you'll need v2.7.0 or newer for that. See the steps below to install.
If you don't have Helm installed already,
download the helm
CLI and
then run helm init
(this installs Tiller, the server-side component of
Helm, into your Kubernetes cluster).
If you already have Helm installed, run helm version
and ensure that both
the client and server versions are v2.7.0
or above.
If they aren't,
install a newer version of the helm
CLI
and run helm init --upgrade
.
For more details on installation, see the Helm installation instructions.
Service Catalog is easily installed via a Helm chart.
This chart is located in a chart repository just for Service Catalog. Add this repository to your local machine:
helm repo add svc-cat https://kubernetes-sigs.github.io/service-catalog
Then, ensure that the repository was successfully added:
{{< tabs name="helm-versions" >}} {{% tab name="Helm version 3" %}}
helm search repo service-catalog
{{% /tab %}} {{% tab name="Helm version 2" %}}
helm search service-catalog
{{% /tab %}} {{< /tabs >}} You should see the following output:
NAME VERSION DESCRIPTION
svc-cat/catalog 0.3.X service-catalog helm chart
svc-cat/catalog-v0.2 0.2.X service-catalog API server and controller-manager helm chart
Your Kubernetes cluster must have RBAC enabled to use Service Catalog.
Like in-cluster DNS, many installation methods should enable RBAC for you.
When using Minikube v0.25 or older, you must run Minikube with RBAC explicitly enabled:
minikube start --extra-config=apiserver.Authorization.Mode=RBAC
When using Minikube v0.26+, run the following command:
minikube start
With Minikube v0.26+, do not specify --extra-config
. The
flag has since been changed to --extra-config=apiserver.authorization-mode
and
Minikube now uses RBAC by default. Specifying the older flag may cause the
start command to hang.
If you are using the
hack/local-up-cluster.sh
script in the Kubernetes core repository, start your cluster with this command:
AUTHORIZATION_MODE=Node,RBAC hack/local-up-cluster.sh -O
Many cloud providers set up new clusters with RBAC enabled for you. Please check with your provider's documentation for details.
Now that your cluster and Helm are configured properly, installing Service Catalog is simple: {{< tabs name="helm versions" >}} {{% tab name="Helm version 3" %}}
helm install catalog svc-cat/catalog --namespace catalog --create-namespace
{{% /tab %}} {{% tab name="helm version 2" %}}
helm install svc-cat/catalog --name catalog --namespace catalog
{{% /tab %}} {{< /tabs >}} If you want to install older version of service catalog (for instance the API-server based version from v0.2 branch) append branch name to the chart name:
{{< tabs name="Helm3" >}} {{% tab name="Helm3" %}}
helm install catalog svc-cat/catalog-v0.2 --namespace catalog
{{% /tab %}} {{% tab name="Helm2" %}}
helm install svc-cat/catalog-v0.2 --name catalog --namespace catalog
{{% /tab %}} {{< /tabs >}}
Follow the appropriate instructions for your operating system to install svcat. The binary can be used by itself, or as a kubectl plugin.
The snippets below install the latest version of svcat. We also publish binaries for our canary builds, and tags using the following prefixes:
-
Latest release:
-
Canary builds:
-
Tagged releases: https://download.svcat.sh/cli/VERSION where
VERSION
is the release, for examplev0.3.1
,v0.2.1
, etc. -
Previous canary builds: https://download.svcat.sh/cli/VERSION-GITDESCRIBE where
GITDESCRIBE
is the result of callinggit describe --tags
, for examplev0.3.0-1-g84216bdf
,v0.2.1-1-g203c8ad
etc.
brew update
brew install kubernetes-service-catalog-client
curl -sLO https://download.svcat.sh/cli/latest/darwin/amd64/svcat
chmod +x ./svcat
mv ./svcat /usr/local/bin/
svcat version --client
curl -sLO https://download.svcat.sh/cli/latest/linux/amd64/svcat
chmod +x ./svcat
mv ./svcat /usr/local/bin/
svcat version --client
The PowerShell snippet below adds a directory to your PATH for the current session only. You will need to find a permanent location for it and add it to your PATH.
iwr 'https://download.svcat.sh/cli/latest/windows/amd64/svcat.exe' -UseBasicParsing -OutFile svcat.exe
mkdir -f ~\bin
Move-Item -Path svcat.exe -Destination ~\bin
$env:PATH += ";${pwd}\bin"
svcat version --client
- Download the appropriate binary for your operating system:
- Make the binary executable.
- Move the binary to a directory on your PATH.
To use svcat as a plugin, run the following command after downloading:
$ ./svcat install plugin
Plugin has been installed to ~/.kube/plugins/svcat. Run kubectl plugin svcat --help for help using the plugin.
When operating as a plugin, the commands are the same with the addition of the global
kubectl configuration flags. One exception is that boolean flags aren't supported
when running in plugin mode, so instead of using --flag
you must specify a value --flag=true
.