Skip to content

Instantly share code, notes, and snippets.

@scottcrawford03
Last active December 21, 2018 21:01
Show Gist options
  • Save scottcrawford03/d6461acd6edea454af65c0d0137a7cde to your computer and use it in GitHub Desktop.
Save scottcrawford03/d6461acd6edea454af65c0d0137a7cde to your computer and use it in GitHub Desktop.

K8s Cluster Side of the House

Steps to add a service catalog to a kubernetes cluster on DigitalOcean

  1. log into do and provision a new cluster

  2. set up service catalog via helm (commands pulled from https://kubernetes.io/docs/tasks/service-catalog/install-service-catalog-using-helm/#before-you-begin)

    • helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com
    • helm search service-catalog -- if the instillation was successful you should see this:
      NAME            VERSION DESCRIPTION
      svc-cat/catalog 0.0.1   service-catalog API server and controller-manag...
      
    • configure tiller to have cluster-admin access
      kubectl create clusterrolebinding tiller-cluster-admin \
           --clusterrole=cluster-admin \
           --serviceaccount=kube-system:default
      
    • helm init
      • this creates a tiller pod. might take a moment to provision so wait a little before running next command.
    • install svc-cat under the catalog namespace
      helm install svc-cat/catalog \
           --name catalog --namespace catalog
      
    • check it worked with kubectl get deployments --namespace=catalog
  3. Setup your cluster with secrets and a cluster service broker

    • create secret file with basic auth under your catalog namespace:
      kubectl create secret generic auth --namespace=catalog \
           --from-literal username=ignoreme \
           --from-literal password=ignoreme
      
    • create a service yaml file (make sure the namespace/name matches the your secret):
      apiVersion: servicecatalog.k8s.io/v1beta1
         kind: ClusterServiceBroker
         metadata:
           name: new-broker
         spec:
           url: your_broker_url
         authInfo:
           basic:
             secretRef:
               namespace: catalog
               name: auth
      
    • create a cluster service broker from that yaml file kubectl create -f ./test-service-broker.yaml (path to your yaml file you just created)
    • check it worked with kubectl get clusterservicebrokers new-broker -o yaml
      • you'll see a status key and it should say successfully fetched catalog.

Service Broker side of the house

COMING SOON