Development Environment Setup

OK. So you want to get started with Golang/Kubernetes development. You’ve come to the right place. Read on.

1 Install Golang

Head to the official website and click the “Download” button:

Development Environment Setup - 图1

Make sure you select the correct package according to your operating system and processor:

Development Environment Setup - 图2

For Apple macOS users, click the apple logo in the menu bar, and choose “About This Mac” to check your chip:

Development Environment Setup - 图3


2 Install Kubernetes

The easiest way to run a Kubernetes cluster locally is to run it in a Docker container.

2.1 Install Docker

Head to the official website and click the download button:

Development Environment Setup - 图4

Again, please pay attention to the operating system and processor options. For Apple M1 mac users, choose the “Apple Chip” option. To check what processor you have, see the previous section in “About This Mac”.

After installation, make sure Docker is up and running.

2.2 Install Minikube

Minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.

All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away.

Note: there are other tools which can install a local K8s, such as kind, etc.; here we choose one of the most famous tools that is minikube as the demo.

First, go to the official website of minikube, choose the right OS and architecture (again,) and download/install:

Development Environment Setup - 图5

Alternatively, if you are using Homebrew (if you don’t know what it is, ignore this line,) you can simply run brew install minikube.

2.3 Install kubectl

Go to Kubernetes’ official documentation website and follow the guide to install kubectl. Choose your operating system:

Development Environment Setup - 图6

Again, for macOS users, if you are using Homebrew package manager, you can install kubectl with Homebrew:

Bash

  1. brew install kubectl

2.4 Start K8s

Run:

Bash

  1. minikube start --driver=docker

Note: if you would like to set Docker as the default driver for minikube, you can run:

Bash

  1. minikube config set driver docker

Then next time when you want to start minikube, you can simply run minikube start without the --driver=docker parameter.

2.5 Check K8s Status

Run minikube status, and you should get similar output:

Bash

  1. $ minikube status
  2. minikube
  3. type: Control Plane
  4. host: Running
  5. kubelet: Running
  6. apiserver: Running
  7. kubeconfig: Configured

Run kubectl get node, and you should get similar output:

Bash

  1. $ kubectl get node
  2. NAME STATUS ROLES AGE VERSION
  3. minikube Ready control-plane 55s v1.24.3

OK, now you have Golang and Kubernetes ready locally. Start coding!


3 Contribute to DevStream

Run:

Bash

  1. git clone https://github.com/devstream-io/devstream.git

and start from there!

For example, you can try a local build:

Bash

  1. make build -j10 VERSION=0.8.0

Or, maybe you would like to have a go with it first? Check our quickstart guide. Happy hacking!