Git Product home page Git Product logo

k8s-bootstrap's Introduction

KUBERNETES DEVOPS BOOTSTRAP

Getting Started

This project uses devbox to manage its development environment.

Install devbox:

curl -fsSL https://get.jetpack.io/devbox | bash

Start the devbox shell:

devbox shell

General purpose

This project is a POC to manage k8s at edge clusters with the couple k3s/argo.

Commands

# -----------------------------
# prepare env vars
# -----------------------------
# you need to generate token for k3s clusters, in our case twice
$ ./scripts/generate-token.sh
# create a .env file with those two tokens
K3S_VERSION="v1.29.4-k3s1"
K3S_CONTROLLER_TOKEN="yYkWDY.cpIhCbSA9gV5FJRl"
K3S_EDGE_TOKEN="ZZw3Xo.SIzIGQKHL8bHLs51"
# -----------------------------
# prepare docker network
# -----------------------------
# to simulate the private network
$ docker network create --driver bridge --subnet 172.29.0.0/16 k8s-bootstrap
# -----------------------------
# k8s controller cluster
# -----------------------------
$ devbox run controller:start
# stop the k8s controller cluster
$ devbox run controller:stop
# -----------------------------
# k8s edge cluster
# -----------------------------
$ devbox run edge:start
# stop the k8s edge cluster
$ devbox run edge:stop
CONTAINER ID   IMAGE                      COMMAND                  CREATED          STATUS          PORTS                                                                      NAMES
de7402dbd381   rancher/k3s:v1.29.4-k3s1   "/bin/k3s agent --no…"   15 seconds ago   Up 13 seconds                                                                              edge-agent
e8b98f73c3cf   rancher/k3s:v1.29.4-k3s1   "/bin/k3s server --d…"   15 seconds ago   Up 14 seconds                                                                              edge-server
8781698f2fdb   rancher/k3s:v1.29.4-k3s1   "/bin/k3s agent --no…"   21 seconds ago   Up 19 seconds                                                                              controller-agent
04eb9fd9599d   rancher/k3s:v1.29.4-k3s1   "/bin/k3s server --d…"   21 seconds ago   Up 20 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   controller-server
# -----------------------------
# last step get the 2 kubeconfigs
# -----------------------------
$ devbox run kubeconfigs

Istio multi clusters

$ istioctl install -y --kubeconfig .kubeconfigs/controller.yaml --filename istio/controller.yaml
$ istioctl install -y --kubeconfig .kubeconfigs/edge.yaml --filename istio/edge.yaml

Terraform

# -----------------------------
# time to terraform the controller
# -----------------------------
# because of issue: https://github.com/hashicorp/terraform-provider-kubernetes/issues/1583
$ devbox run controller:tf init
$ devbox run controller:tf apply -target helm_release.argo_cd
# once the target is done, you can do:
$ devbox run controller:tf [init apply, plan, etc]

Web sites

k8s-bootstrap's People

Stargazers

PERREYMOND Gilles avatar

Watchers

PERREYMOND Gilles 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.