Git Product home page Git Product logo

coscup_2017's Introduction

COSCUP 2017 - Infrastructure As Code

This repository is for demonstrate below items:

  • Jenkins: Pipeline As Code
  • Terraform: Infrastructure As Code (Wait For DevOpsDays Taipei 2017)
  • CM: Provision As Code
  • Packer: Image As Code
  • Docker: Server As Code
  • Kubernetes: Orchestration As Code
  • Hubot: Chat As Code

There are three modules need to be setup...

Prerequisite

  • Linux Based Machine
  • Slack Account
  • Docker
  • DockerHub Account

Kubernetes (power by minikube)

  • Follow official document to install minikube

  • Follow official document to install kubectl

  • Within this repository to start minikube with below command

     # Specific VM driver by --vm-driver flag if needed, VM driver is one of: [virtualbox xhyve vmwarefusion] (default "virtualbox")
     
     ~$ minikube start
     
     ...
     Starting local Kubernetes v1.6.4 cluster...
     Starting VM...
     Moving files into cluster...
     Setting up certs...
     Starting cluster components...
     Connecting to cluster...
     Setting up kubeconfig...
     Kubectl is now configured to use the cluster.
    
  • There should be a file named kubeconfig is generated, kubectl use this file to communicate with minikube

Jenkins (power by container)

  • Within this repository, get minikube master endpoint & bearer token by kubectl

     ~$ kubectl cluster-info
     
     Kubernetes master is running at https://192.168.64.2:8443
     
     ~$ KUBERNETES_TOKEN=$(kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t')
    
  • Export minikube master endpoint & bearer token

     export KUBERNETES_ENDPOINT="192.168.64.2:8443"
     export KUBERNETES_TOKEN=$KUBERNETES_TOKEN
    
  • Export dockerhub username and password

     export DOCKERHUB_USERNAME="XXXXXX"
     export DOCKERHUB_PASSWORD="XXXXXX"
    
  • Execute below command to launch Jenkins

     ~$ ./jenkins.container
     
     Pull the image: jenkins/jenkins:lts
     lts: Pulling from jenkins/jenkins
     Digest: sha256:00d924e51f89ee01cf4b11ebedb92148976c3ac03f5cdc717ccf49852e1d7893
     Status: Image is up to date for jenkins/jenkins:lts
     
     Starting Docker container: jenkins/jenkins:lts
     Container ID: jenkins-1501424671
     1638d5ffc3c25f0a62e737e5b1c8090a2028c2d3dd9cd613a24873022dc93327
    
  • Visit http://127.0.0.1 from the browser after several minutes

  • Login Jenkins by below account and password

    • Admin Account : coscup
    • Admin Password : coscup

Hubot (power by local)

  • Install necessary npm package

     ~$ npm install -g hubot coffee-script yo generator-hubot
    
  • GET the Hubot Slack token here, then export it

     ~$ export HUBOT_SLACK_TOKEN="**************"
    
  • Export jenkins information

     ~$ export HUBOT_JENKINS_URL="http://127.0.0.1"
    ~$ export HUBOT_JENKINS_AUTH="coscup:coscup"
    
  • Execute below command to launch hubbot in local

     ~$ cd hubot_home
     ~$ ./bin/hubot --adapter slack
    

coscup_2017's People

Stargazers

 avatar MoA avatar Bryan Yang avatar XC avatar Wonder Chang avatar Bear Su avatar Shawn Chen avatar  avatar 張泰瑋(Chang Tai Wei) avatar Kewang avatar

Watchers

James Cloos avatar MoA avatar Mike Fang avatar  avatar

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.