Coder Social home page Coder Social logo

jkevlin / kubernetes-macosx-development Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrishoffman/kubernetes-macosx-development

0.0 0.0 0.0 42 KB

Vagrant config to run a full local Kubernetes cluster using the source directory from your Mac.

License: MIT License

Shell 100.00%

kubernetes-macosx-development's Introduction

Developing Kubernetes on Mac OS X

Kubernetes comes with a great script that lets you run an entire cluster locally using your current source code tree named hack/local-up-cluster.sh. However, it only runs on Linux, which means that if you're developing on your Mac you have to copy your source tree to a Linux machine to use the script (or switch to a Linux machine for development). Go in general, however, runs fine on Mac, so here is the flow that this Vagrant configuration aims to enable:

  • Edit source files on your Mac's checkout of Kubernetes and use go build (for syntax checking) and go test (for unit tests) directly on your Mac.
  • Run vagrant up (in this directory) to automatically:
  • Launch a Centos 7 VM on your Mac that has Go and Docker installed on the IP 10.1.2.3.
  • Enable the ability to run a Kubernetes cluster using hack/local-up-cluster.sh.

Getting started

You must have the following installed:

  • Virtualbox >= 5.1.22
  • Vagrant >= 1.9.5
  • vagrant-vbguest Vagrant plugin.
    • Install by running: vagrant plugin install vagrant-vbguest. We use the official CentOS 7 Vagrant box, which does not come with Virtualbox Guest Additions - installing this plugin ensures that the additions are installed on first vagrant up.
  • Go >= 1.8.3

Next, install Kubernetes to your GOPATH by running go get k8s.io/kubernetes/.... If you want to write and contribute code, fork Kubernetes with your user on GitHub, and add your repo as a remote to your local checkout by running:

Once you have a Kubernetes checkout in your GOPATH:

  1. git clone this repo (it does not need to be in your GOPATH) and cd into it.
  2. Run vagrant up. That will start up the VM and bootstrap it with docker, go, and your $GOPATH to /go (amongst other things; see setup.sh for the complete bootstrapping process).
  3. Use vagrant ssh to SSH into the VM.
  4. Enter sudo -i /go/src/k8s.io/kubernetes/hack/local-up-cluster.sh to start up a cluster using the code in your checkout.

The kubernetes apiserver is run on 10.1.2.3, not on 127.0.0.1, in order to enable access from your OS X host machine. If you want to use kubectl from your Mac, run export KUBERNETES_MASTER=10.1.2.3:8080 (the VM's environment is already preconfigured as such).

kubernetes-macosx-development's People

Contributors

ahakanbaba avatar chrishoffman avatar andronat avatar gkeramidas avatar arun-gupta 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.