All Projects → jnewland → Local Dev With Docker For Mac Kubernetes

jnewland / Local Dev With Docker For Mac Kubernetes

Notes about local development with Docker for Mac and Kubernetes

Labels

Projects that are alternatives of or similar to Local Dev With Docker For Mac Kubernetes

Sqlite3 Android
SQLite CLI and Library build scripts for Android
Stars: ✭ 83 (-8.79%)
Mutual labels:  makefile
Sinetek Rtsx
macOS driver for Realtek SD card readers.
Stars: ✭ 85 (-6.59%)
Mutual labels:  makefile
Android device xiaomi gemini
Stars: ✭ 89 (-2.2%)
Mutual labels:  makefile
Device Sony Yuga
Stars: ✭ 83 (-8.79%)
Mutual labels:  makefile
Passport Strategy
An abstract class implementing Passport's strategy API.
Stars: ✭ 84 (-7.69%)
Mutual labels:  makefile
Make Handbook
Handbook about modern make usage
Stars: ✭ 85 (-6.59%)
Mutual labels:  makefile
Vala Object
Use Vala from Ruby, Python, Lua, JavaScript (Node.js, gjs, seed) and many other languages
Stars: ✭ 82 (-9.89%)
Mutual labels:  makefile
Drake
An R-focused pipeline toolkit for reproducibility and high-performance computing
Stars: ✭ 1,301 (+1329.67%)
Mutual labels:  makefile
Firmware
Armbian firmware
Stars: ✭ 85 (-6.59%)
Mutual labels:  makefile
Cardano Tutorials
ARCHIVED-This content in this repository is now located at https://docs.cardano.org/projects/cardano-node/
Stars: ✭ 89 (-2.2%)
Mutual labels:  makefile
Riscv Sbi Doc
Documentation for the RISC-V Supervisor Binary Interface
Stars: ✭ 84 (-7.69%)
Mutual labels:  makefile
Deep Base
Deep learning base image for Docker (Tensorflow, Caffe, MXNet, Torch, Openface, etc.)
Stars: ✭ 84 (-7.69%)
Mutual labels:  makefile
Value Investing Newbie
Stars: ✭ 87 (-4.4%)
Mutual labels:  makefile
Kodi Standalone Service
A systemd service to allow for standalone operation of kodi.
Stars: ✭ 83 (-8.79%)
Mutual labels:  makefile
Animation Worklet
🚫 Old repository for AnimationWorklet specification ➡️ New repository: https://github.com/w3c/css-houdini-drafts
Stars: ✭ 89 (-2.2%)
Mutual labels:  makefile
Wiki
Archive of free60.org mediawiki
Stars: ✭ 83 (-8.79%)
Mutual labels:  makefile
Crab project
ROS hexapod robot on BeagleBone Black
Stars: ✭ 85 (-6.59%)
Mutual labels:  makefile
Flash2cocos2d X
use this tool you can export the flash data, and use the data in cocos2d-x game
Stars: ✭ 90 (-1.1%)
Mutual labels:  makefile
Apk File
Search apk package contents via the command line.
Stars: ✭ 89 (-2.2%)
Mutual labels:  makefile
Wayland Protocols
Wayland protocol development
Stars: ✭ 87 (-4.4%)
Mutual labels:  makefile

Local development with Docker for Mac and Kubernetes

Docker for Mac's new Kubernetes support enables some pretty rad patterns for local development. If you run services on Kubernetes in production are are interested in running them in a similar environment on your Mac, you might be interested in some of these patterns.

Accessing services from your Mac

Docker for Mac exposes Kubernetes Services of type LoadBalancer to your Mac's network using vpnkit. There's an example echo server in ./echo/. Here's how it works on my Mac:

Apply the resources in ./echo/ to start the echo server:

$ kubectl apply -Rf ./echo/
deployment "echo" configured
service "echo" configured

Confirm the deployment is running:

$ kubectl get deployment echo
NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
echo      1         1         1            1           1m

Test it out:

$ sudo lsof -Pnitcp | grep 3333
vpnkit    54100 jnewland   32u  IPv4 0x86c54c0d101bc03f      0t0  TCP *:3333 (LISTEN)
vpnkit    54100 jnewland   34u  IPv6 0x86c54c0cee4cef17      0t0  TCP [::1]:3333 (LISTEN)

$ echo "$RANDOM" | nc localhost 3333
144

Cleanup:

$ kubectl delete svc echo
service "echo" deleted
$ kubectl delete deployment echo
deployment "echo" deleted

There are only so many ports, though, and it's kinda hard to remember what port is assigned to an application you rarely use. If you expect to run multiple Kubernetes applications on your Mac (say, a business of microservices), you might want to be able to access each of these services without remembering which port you've allocated to them.

Accessing HTTP(s) services with nginx-ingress and xip.io

The NGINX Ingress Controller can run on ports 80 and 443, allowing you to configure which Service is available at a given hostname using Ingress resources. Combined with xip.io, you can configure access to HTTP services locally using addresses like http://$service.127.0.0.1.xip.io/.

Setup nginx-ingress

  • Disable other things listening on port 80 / 443 on your Mac:
    • (You might need to sudo brew services stop launch_socket_server)
  • Install a recent version of Docker for Mac and enable Kubernetes
  • Deploy nginx-ingress:
kubectl apply -f nginx-ingress/namespaces/nginx-ingress.yaml -Rf nginx-ingress

Setup the example application

./httpbin/ contains an example a the configuration that might live in an individual application repo. If the all members of your engineering organization have a similar ingress controller running on their development machines, the development patterns in that directory can be used for multiple services. That's pretty cool.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].