Giter Club home page Giter Club logo

kubernetes's Introduction

Deploying OverOps in a Kubernetes cluster

Starting from scratch, we'll deploy a Kubernetes cluster locally with Minikube, we'll build and deploy the Collector as a service in the cluster, and we'll attach the Agent to error generating demo apps.

Prerequisites

First, install Docker and Kubernetes if you have not already done so.

Install Docker

Download and install Docker Community Edition for your platform. I'm using the Mac edition.

After installing, you'll have the docker command available from the command line.

$ docker --version
Docker version 18.09.0, build 4d60db4

Install Kubectl

Download and install kubectl. If you're on a Mac, I recommend using Homebrew to install kubectl:

$ brew install kubernetes-cli

After installing, you'll have the kubectl command available from the command line.

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.2", GitCommit:"17c77c7898218073f14c8d573582e8d2313dc740", GitTreeState:"clean", BuildDate:"2018-10-30T21:39:38Z", GoVersion:"go1.11.1", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: dial tcp 192.168.99.100:8443: i/o timeout

Install Minikube

Download and install Minikube according to the instructions for the latest release. See Running Kubernetes locally via Minikube to familiarize yourself with the tool.

After installing, you'll have the minikube command available from the command line.

$ minikube version
minikube version: v0.30.0

Start your cluster

To start the cluster, simply run minikube start:

$ minikube start

Set Docker environmental variables

Prior to building Docker images, you'll need to configure your Docker environment to use your Minikube cluster by running the following command:

$ eval $(minikube docker-env)

This command needs to be run each time you open a new command line window.

Heads up! When building local images to deploy with Kubernetes, set imagePullPolicy: Never on the container spec. This prevents your cluster from attempting to remotely fetch a local image.

Stop your cluster

To stop the cluster, simply run minikube stop.

Next Steps

Docker Commands Cheat Sheet

Basic Docker commands can be found on the Docker Cheat Sheet

  • build a container docker build . -t my-container
  • run a container docker run my-container
  • run a container interactively docker run -it my-container /bin/bash
  • list containers docker container ls
  • list images docker image ls
  • remove all containers docker container rm $(docker container ls -aq)
  • remove all images docker image rm $(docker image ls -q)

Kubernetes Commands Cheat Sheet

Basic Kubernetes command can be found on the Kubernetes Cheat Sheet

  • create from a config file kubectl create -f config.yaml
  • delete from a config file kubectl delete -f config.yaml
  • get pods kubectl get pods
  • get deployments kubectl get deployments
  • get services kubectl get services
  • tail pod logs kubectl tail -f my-pod
  • get logs for a deployment by tag kubectl logs -l app=my-app
  • scale a deployment kubectl scale deployment my-deployment --replicas=3
  • autoscale a deployment kubectl autoscale deployment my-deployment --min=1 --max=3
  • get autoscaling rules kubectl get hpa
  • delete autoscaling rule kubectl delete hpa my-deployment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.