This repository was archived by the owner on Aug 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
95 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
   | ||
|
||
# Overview | ||
This repository contains scripts to start Kyma on local K3S cluster in about 5 minutes! | ||
This repository contains scripts to start Kyma on local kubernetes cluster (k3s) in about 5 minutes! | ||
|
||
> Tested on Mac Book Pro 2017 (2,9 GHz Quad-Core Intel Core i7, 16 GB RAM, SSD disk) | ||
|
||
# Prerequisites | ||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||
- [helm 3](https://helm.sh/docs/intro/quickstart/#install-helm) | ||
|
@@ -15,8 +14,8 @@ This repository contains scripts to start Kyma on local K3S cluster in about 5 m | |
|
||
Checkout this repository and go to the main folder: | ||
``` | ||
git clone [email protected]:kyma-incubator/local-kyma-k3d.git | ||
cd local-kyma-k3d | ||
git clone [email protected]:kyma-incubator/local-kyma.git | ||
cd local-kyma | ||
``` | ||
|
||
Download kyma charts to resources subfolder: | ||
|
@@ -40,7 +39,7 @@ Your cluster is ready! | |
|
||
 | ||
|
||
# Clean up | ||
When you are done you can clean up with this command: | ||
|
||
``` | ||
./kyma-k3d-delete.sh | ||
|
@@ -108,12 +107,29 @@ Please bear in mind that after restart Kubernetes will probably restart most of | |
|
||
## Can I use the script on Linux or Windows | ||
|
||
The script was tested only on Mac OS. It should not be a big problem to adapt it to Linux, but it wasn't tested there. There is a plan to move the script to Kyma CLI - once it is done all platforms will be supported. | ||
The script was tested only on Mac OS and Linux (ubuntu). Please be aware that for Linux you should use k3s (not k3d) version of create cluster script. It should also work with Windows Linux Subsystem (WSL 2), but I didn't test it yet. | ||
|
||
--- | ||
## Why not minikube? | ||
## I see k3s, k3d, kind and minikube - what should I use? | ||
|
||
Short answer: k3d (Mac Os) or k3s (Linux, WSL). | ||
|
||
Long answer: | ||
|
||
K3d is a docker wrapper around k3s (which runs on linux only) - it is more or less the same. Here is a small comparison with kind and minikube: | ||
|
||
| | k3s/k3d | minikube | kind | | ||
----|:-------:|:--------:|:----:| | ||
K8s installation + startup time | ~ 25 sec | ~ 90 sec | ~ 100 sec | ||
Cluster startup time (second run) | ~ 15 sec | ~ 30 sec | ~ 30 sec | ||
Allocated memory (e2e scenario) | 4.2 GB | 6.6 GB | 6.8 GB | ||
Kyma installation time | ~ 3 min | ~ 5-6 min | ~ 4-5 min | ||
LoadBalancer support | yes | yes/no (requires another process for minikube tunnel command) | no | ||
Expose LB ports on host machine (use localhost) | yes | yes(mac) / no(linux) | yes/no (extraPortMappings to service exposed with NodePort) | ||
|
||
Summary: if you pick minikube or kind you need 50% more resources, 50% more time for cluster startup or Kyma installation and you need a special configuration or process to access ingress gateway from your localhost. | ||
|
||
K3S starts in about 10 seconds - you can use kubeconfig and access API server. It also takes fewer resources than minikube. For the local development, speed and low resource consumption are critical requirements. | ||
**A winner is: k3s/k3d!** | ||
|
||
--- | ||
## What are the hardware requirements to run Kyma locally? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
|
||
echo "starting docker registry" | ||
sudo mkdir -p /etc/rancher/k3s | ||
sudo cp registries.yaml /etc/rancher/k3s | ||
docker run -d \ | ||
-p 5000:5000 \ | ||
--restart=always \ | ||
--name registry.localhost \ | ||
-v $PWD/registry:/var/lib/registry \ | ||
registry:2 | ||
|
||
echo "starting cluster" | ||
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=777 INSTALL_K3S_EXEC="server --disable traefik" sh - | ||
mkdir -p ~/.kube | ||
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config | ||
chmod 600 ~/.kube/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
|
||
# Start docker Registry | ||
docker run -d \ | ||
-p 5000:5000 \ | ||
--restart=always \ | ||
--name registry.localhost \ | ||
-v $PWD/registry:/var/lib/registry \ | ||
registry:2 | ||
|
||
echo "Starting cluster" | ||
minikube start --memory=6800m --kubernetes-version=1.18.9 --insecure-registry="registry.localhost:5000" | ||
minikube ssh "sudo sh -c \"grep host.minikube.internal /etc/hosts | sed s/host.minikube.internal/registry.localhost/ >>/etc/hosts\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
./create-cluster.sh | ||
./install-istio.sh | ||
#!/bin/bash | ||
set -o errexit | ||
|
||
./create-cluster-k3d.sh | ||
./install-istio.sh -f config-istio.yaml | ||
./install-kyma.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
./create-cluster-kind.sh | ||
./install-istio.sh | ||
./install-istio.sh -f config-istio-nodeport.yaml | ||
./install-kyma.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
set -o errexit | ||
|
||
minikube delete | ||
docker rm -f registry.localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -o errexit | ||
|
||
./create-cluster-minikube.sh | ||
./install-istio.sh -f config-istio.yaml | ||
IP=$(minikube ssh "grep host.minikube.internal /etc/hosts | cut -f1") | ||
export REGISTRY_IP=${IP//[$'\t\r\n ']} | ||
./install-kyma.sh |