Public Repository

Last pushed: 2 years ago
Short Description
Config graph generator for Kubernetes
Full Description

This is a Docker-ized version of the Castanet collector service for
getting the config graph of a Kubernetes cluster.

Instructions to deploy this service on the Google Cloud Platform:

  1. Find the Kubernetes master and minion nodes:

    • gcloud config set project <YOUR-KUBERNETES-PROJECT-ID>.
    • gcloud compute instances list.
    • The Kubernetes master will have the name "k8s-...-master" and the minion
      nodes will have the name "k8s-...-node-N".
  2. On each of the N minion nodes, enable the Docker REST API on port 4243:

    • SSH into the node: gcloud compute ssh k8s-...-node-N.
    • Edit /etc/default/docker and change the first line from DOCKER_OPTS=""
      to:
      DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'.
    • Restart the Docker service: sudo service docker restart.
  3. Set up the Castanet collector service on the Kubernetes master:

    • SSH into the master: gcloud compute ssh k8s-...-master.
    • Start the Docker service if it is NOT already running: sudo service docker start.
    • Download the Castanet Docker image from Docker Hub: sudo docker pull vasbala/castanet. Alternatively,
      if you want to build this Docker image from source, see instructions below.
    • Start the container:
      sudo docker run -d --net=host -p 5555:5555 --name castanet-collector vasbala/castanet
    • Check that you have the "castanet-collector" container running:
      sudo docker ps | grep castanet-collector
  4. Create a firewall rule to allow HTTP traffic to the Kubernetes master on port 5555:
    gcloud compute firewall-rules create "castanet-collector" --allow tcp:5555 --network "default" --source-ranges "0.0.0.0/0" --target-tags k8s-...-master

  5. Access the Castanet service from a browser to see the top-level help page:

    • Find the external IP address of the Kubernetes master by typing gcloud compute instances list
      and noting the EXTERNAL_IP for the k8s-...-master instance.
    • From a browser go to the URL http://EXTERNAL_IP:5555. You should see
      a top level API help page.

How to build the Castanet collector Docker image from source:

  1. Download the source from GitHub: git clone https://github.com/kraken-people/castanet.git

  2. Make this your working directory by cd-ing into it.

  3. Build the Docker image: sudo docker build -t vasbala/castanet . (don't forget the
    trailing ".")

  4. You should now have a local Docker image named vasbala/castanet: sudo docker images.

  5. Follow the instructions above on how to deploy the container in a Kubernetes cluster,
    skipping the step to "Download the Castanet Docker image from Docker Hub".

Docker Pull Command
Owner
vasbala

Comments (0)