Use Cases

Getting started with PingDirectory on Kubernetes

Before you begin

PingDirectory
Docker

Download and install Docker Desktop. Learn more in Install Docker Desktop on Mac in the Docker documentation.

About this task

Follow these steps to run PingDirectory in a Kubernetes container on a MacOS system.

Steps

  1. Launch Docker and enable Kubernetes in Docker. Learn more in Sign in to Docker Desktop and Install and turn on Kubernetes in the Docker documentation.

  2. Verify that Kubernetes is running. Learn more in Deploy on Kubernetes with Docker Desktop in the Docker documentation.

    Example:

    $ kubectl version
    Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
  3. Confirm that the Kubernetes context is set to your local desktop.

    Kubernetes has contexts that allow you to manage different Kubernetes cluster environments. By default, when you enable Kubernetes on Docker Desktop, Kubernetes creates a local context.

    Example:

    $ kubectl config current-context
    docker-desktop
  4. Create a dashboard to manage your Kubernetes cluster. Learn more in Deploy and Access the Kubernetes Dashboard in the Kubernetes documentation.

    Example:

    $ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
    secret "kubernetes-dashboard-certs" created
    serviceaccount "kubernetes-dashboard" created
    role.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
    rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
    deployment.apps "kubernetes-dashboard" created
    service "kubernetes-dashboard" created
  5. Verify that the dashboard has started.

    Example:

    $ kubectl get pods --namespace=kube-system
    NAME READY STATUS RESTARTS AGE
    etcd-docker-desktop 1/1 Running 1 13d
    kube-apiserver-docker-desktop 1/1 Running 1 13d
    kube-controller-manager-docker-desktop 1/1 Running 1 13d
    kube-dns-86f4d74b45-d72qr 3/3 Running 0 13d
    kube-proxy-2ntt5 1/1 Running 0 13d
    kube-scheduler-docker-desktop 1/1 Running 1 13d
    kubernetes-dashboard-7d5dcdb6d9-qqxn9 1/1 Running 0 9m
  6. To enable browsing to the dashboard, set up forwarding from the Kubernetes host to the container port.

    Example:

    $ kubectl port-forward kubernetes-dashboard-7d5dcdb6d9-qqxn9 8443:8443 --namespace=kube-system
    Forwarding from 127.0.0.1:8443 -> 8443
    Forwarding from [::1]:8443 -> 8443
  7. In a browser window, go to the dashboard at https://localhost:8443/.

  8. In Kubernetes, create a PingDirectory configmap. Learn more about creating a configmap in the Kubernetes documentation.

    Example:

    $ kubectl create configmap ping-directory-config --from-file=/path/to/PingDirectory.lic
    configmap "ping-directory-config" created