|
| 1 | +# Installing Service Catalog on Clusters Running Kubernetes 1.6 (DEPRECATED) |
| 2 | + |
| 3 | +This document contains instructions for installing the Service Catalog onto |
| 4 | +Kubernetes clusters running version 1.6. Since Service Catalog |
| 5 | +only officially supports versions 1.7 and later, these instructions are |
| 6 | +deprecated and may be removed at any time. |
| 7 | + |
| 8 | +If you are running a Kubernetes cluster running version 1.7 or later, please |
| 9 | +see the [installation instructions for 1.7](./install-1.7.md). |
| 10 | + |
| 11 | +# Step 1 - Prerequisites |
| 12 | + |
| 13 | +## Starting Kubernetes with DNS |
| 14 | + |
| 15 | +You *must* have a Kubernetes cluster with cluster DNS enabled. We can't list |
| 16 | +instructions here for enabling cluster DNS for all Kubernetes cluster |
| 17 | +installations, but here are a few notes: |
| 18 | + |
| 19 | +* If you are using Google Container Engine or minikube, you likely have cluster |
| 20 | +DNS enabled already. |
| 21 | +* If you are using hack/local-up-cluster.sh, ensure the |
| 22 | +`KUBE_ENABLE_CLUSTER_DNS` environment variable is set as follows: |
| 23 | + |
| 24 | +```console |
| 25 | +KUBE_ENABLE_CLUSTER_DNS=true hack/local-up-cluster.sh -O |
| 26 | +``` |
| 27 | + |
| 28 | +## Helm |
| 29 | + |
| 30 | +You *must* use [Helm](http://helm.sh/) v2 or newer in the installation steps |
| 31 | +below. |
| 32 | + |
| 33 | +If you already have Helm v2 or newer, execute `helm init` (if you haven't |
| 34 | +already) to install Tiller (the server-side component of Helm), and you should |
| 35 | +be done with Helm setup. |
| 36 | + |
| 37 | +If you don't already have Helm v2, see the |
| 38 | +[installation instructions](https://github.com/kubernetes/helm/blob/master/docs/install.md). |
| 39 | + |
| 40 | +If your kubernetes cluster has |
| 41 | +[RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) enabled, you must |
| 42 | +ensure that the tiller pod has `cluster-admin` access. By default, `helm init` |
| 43 | +installs the tiller pod into `kube-system` namespace, with tiller configured to |
| 44 | +use the `default` service account. |
| 45 | + |
| 46 | +```console |
| 47 | +kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default |
| 48 | +``` |
| 49 | + |
| 50 | +`cluster-admin` access is required in order for helm to work correctly in |
| 51 | +clusters with RBAC enabled. If you used the `--tiller-namespace` or |
| 52 | +`--service-account` flags when running `helm init`, the `--serviceaccount` flag |
| 53 | +in the previous command needs to be adjusted to reference the appropriate |
| 54 | +namespace and ServiceAccount name. |
| 55 | + |
| 56 | +## A Recent `kubectl` |
| 57 | + |
| 58 | +As with Kubernetes itself, interaction with the service catalog system is |
| 59 | +achieved through the `kubectl` command line interface. Chances are high that |
| 60 | +you already have this installed, however, the service catalog *requires* |
| 61 | +`kubectl` version 1.6 or newer. |
| 62 | + |
| 63 | +To proceed, we must: |
| 64 | + |
| 65 | +- Download and install `kubectl` version 1.6 or newer. |
| 66 | +- Configure `kubectl` to communicate with the service catalog's API server. |
| 67 | + |
| 68 | +To install `kubectl` follow the [standard instructions](https://kubernetes.io/docs/tasks/kubectl/install/). |
| 69 | + |
| 70 | +For example, on a mac, |
| 71 | +```console |
| 72 | +curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl |
| 73 | +chmod +x ./kubectl |
| 74 | +``` |
| 75 | + |
| 76 | +We'll assume hereafter that all `kubectl` commands are using this |
| 77 | +newly-installed executable. |
| 78 | + |
| 79 | + |
| 80 | +# Step 2 - Installing the Service Catalog |
| 81 | + |
| 82 | +The service catalog is packaged as a Helm chart located in the |
| 83 | +[charts/catalog](../charts/catalog) directory in this repository, and supports a |
| 84 | +wide variety of customizations which are detailed in that directory's |
| 85 | +[README.md](../charts/catalog/README.md). |
| 86 | + |
| 87 | +## The Service Catalog Data Store |
| 88 | + |
| 89 | +We'll be interacting with a variety of resources in the following steps. The |
| 90 | +service catalog API server needs to store all of these resources in a data |
| 91 | +store. The data store implementation in the API server is pluggable, and we |
| 92 | +currently support the following implementations: |
| 93 | + |
| 94 | +1. Etcd 3 |
| 95 | +2. Third Party Resources (also, known as TPRs) - this is an _alpha_ feature |
| 96 | +right now. It has known issues and may be removed at any time. |
| 97 | + |
| 98 | +The first implementation requires that the API server has access to an Etcd 3 cluster, and the |
| 99 | +second only requires access to the Kubernetes API to store TPRs. |
| 100 | + |
| 101 | +Even if you store data in TPRs, you should still access data via the service catalog API. It is |
| 102 | +possible to access data via the TPRs directly, but we don't recommend it. |
| 103 | + |
| 104 | +## Install |
| 105 | + |
| 106 | +To install the service catalog system with Etcd 3 as the backing data store: |
| 107 | + |
| 108 | +```console |
| 109 | +helm install charts/catalog --name catalog --namespace catalog |
| 110 | +``` |
| 111 | + |
| 112 | +To install the service catalog system with TPRs as the backing data store: |
| 113 | + |
| 114 | +```console |
| 115 | +helm install charts/catalog --name catalog --namespace catalog --set apiserver.storage.type=tpr,apiserver.storage.tpr.globalNamespace=catalog |
| 116 | +``` |
| 117 | + |
| 118 | +Regardless of which data store implementation you choose, the remainder of the steps in this |
| 119 | +walkthrough will stay the same. |
| 120 | + |
| 121 | +## API Server Authentication and Authorization |
| 122 | + |
| 123 | +Authentication and authorization are disabled in the Helm chart by default. To enable them, |
| 124 | +set the `apiserver.auth.enabled` option on the Helm chart: |
| 125 | + |
| 126 | +```console |
| 127 | +helm install charts/catalog --name catalog --namespace catalog --set apiserver.auth.enabled=true |
| 128 | +``` |
| 129 | + |
| 130 | +For more information about certificate setup, see the [documentation on |
| 131 | +authentication and authorization](./auth.md). |
| 132 | + |
| 133 | + |
| 134 | +## Do Overs |
| 135 | + |
| 136 | +If you make a mistake somewhere along the way in this walk-through and want to |
| 137 | +start over, check out the "Final Cleanup" section in the |
| 138 | +[walkthrough document](./walkthrough-1.6.md). Follow those instructions before |
| 139 | +you start over. |
| 140 | + |
| 141 | +## Step 3 - Configuring `kubectl` to Talk to the API Server |
| 142 | + |
| 143 | +To configure `kubectl` to communicate with the service catalog API server, we'll have to |
| 144 | +get the IP address that points to the `Service` that sits in front of the API server pod(s). |
| 145 | +If you installed the catalog with one of the `helm install` commands above, then this service |
| 146 | +will be called `catalog-catalog-apiserver`, and be in the `catalog` namespace. |
| 147 | + |
| 148 | +### Notes on Getting the IP Address |
| 149 | + |
| 150 | +How you get this IP address is highly dependent on your Kubernetes installation |
| 151 | +method. Regardless of how you do it, do not use the Cluster IP of the |
| 152 | +`Service`. The `Service` is created as a `NodePort` in this walkthrough, you |
| 153 | +will need to use the address of one of the nodes in your cluster. |
| 154 | + |
| 155 | +### Setting up a New `kubectl` Context |
| 156 | + |
| 157 | +When you determine the IP address of this service, set its value into the `SVC_CAT_API_SERVER_IP` |
| 158 | +environment variable and then run the following commands: |
| 159 | + |
| 160 | +```console |
| 161 | +kubectl config set-cluster service-catalog --server=https://${SVC_CAT_API_SERVER_IP}:30443 --insecure-skip-tls-verify=true |
| 162 | +kubectl config set-context service-catalog --cluster=service-catalog |
| 163 | +``` |
| 164 | + |
| 165 | +Note: Your cloud provider may require firewall rules to allow your traffic get in. |
| 166 | +Please refer to the [Troubleshooting](./walkthrough-1.6.md#troubleshooting) |
| 167 | +section of the walkthrough document for details. |
0 commit comments