Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

vagrant-kubernetes-puppet

Vagrant Kubernetes including Etcd,Flanneld,Docker in Centos7

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Vagrant-Kubernetes-Puppet

http://jexia.com

Overview

  • The Vagrant-Kubernetes-Puppet module provides the installation procedure for Kubernetes,Etcd,Flanneld,Docker with Puppet at CentOS7_vagrantbox including the Kubernetes API server.
  • If you have EPEL already activated, the module epel is not necessary.

Setup

Usage

To get started, perform a git clone on. Make sure you have Vagrant installed, and also VirtualBox.

pascal
git clone https://github.com/gangsta/vagrant-kubernetes-puppet.git
cd vagrant-kubernetes-puppet/
vagrant up --provider virtualbox

Once vagrant is done provisioning the VMs run vagrant status to confirm all instances are running:

Kubernetes Deployments,Service,Delete.

You can run the kubernetes deployment and service on your cluster by issuing:

pascal
  vagrant ssh kube-master
  kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=docker.io/redis:latest
  kubectl get deployments hello-world
  kubectl describe deployments hello-world
  kubectl expose deployment hello-world --type=LoadBalancer --name=my-service
  kubectl get services my-service
  kubectl describe services my-service

  for pros
  kubectl get pods --output=wide

  Clean Up
  kubectl delete services my-service
  kubectl delete deployment hello-world

Kubernetes RollingUpdat,RollingRollback

pascal
kubectl rollout status deployment/$DEPLOYMENT

Read the deployment history

kubectl rollout history deployment/$DEPLOYMENT
kubectl rollout history deployment/$DEPLOYMENT --revision 42

Rollback to the previous deployed version

kubectl rollout undo deployment/$DEPLOYMENT

Rollback to a specific previously deployed version

kubectl rollout undo deployment/$DEPLOYMENT --to-revision 21

Kubernetes Secrets

pascal
kubectl create secret docker-registry dockerhub --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>

!Note: use --docker-server=https://index.docker.io/v1/ for Hub.Docker.com

kubectl get secret dockerhub --output=yaml

in K8S config

apiVersion: v1
kind: Pod
metadata:
  name: foo
spec:
  containers:
    - name: whatever
      image: index.docker.io/DOCKER_USER/PRIVATE_REPO_NAME:latest
      imagePullPolicy: Always
      command: [ "echo", "SUCCESS" ]
  imagePullSecrets:
    - name: docker-registry

When you're done, you can shut down the cluster using

pascal
vagrant destroy -f

If you want to change any of the configuration/scripts run

pascal
vagrant provision

Docker Build

pascal
docker build -t dockerip:latest .
docker login --username=gangsta
docker tag dockerip:latest gangsta/dockerip:latest
docker push gangsta/dockerip:latest

Docker Cleanup

pascal
docker rmi -f  $(docker images -a -q)
docker rm $(docker ps -a -q)