- Notifications
You must be signed in to change notification settings - Fork0
Kind Cluster Bootstrap + GitOps - Used for Local Kubernetes Development and Testing
License
x-ethr/local-kubernetes-playground
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Software engineers at ETHR previously used a variation of the following project as a playground for softwaredevelopment, automation testing, research, and for demonstrating proof-of-concepts.
This playground was the motivation behind establishingx-ethr
and its related open-source repositories.
Important
The following project requires an expansive amount of knowledge around development, kubernetes, and overallsystems. While the guide can be followed step-by-step to produce a fully functioning cluster, therearerequirements that would otherwise be challenging for beginners to 1. understand, 2. setup, 3.debug.
If requirements are correctly met, the entirety of this project can be deployed in under five minutes by simplyfollowing theusage section.
Users oflocal-kubernetes-playground
will involve themselves in the following disciplines:
- Software Engineering
- DevOps
- Systems Administration
- GitOps
- Databases
- Security
The Playground's Deployed Service Mesh
Important
Usage, requirements, and documentation was vetted on a Mac Studio, M1 Max 2022 on MacOS, Sonoma 14.5. Other systemsare likely subject to incompatibilities.
- MacOS with Administrative Privileges
go
cloud-provider-kind
- Homebrew
- Kind
kubectl
- Docker Desktop
istioctl
ethr-cli
flux
psql
- OpenLens - Kubernetes UI Dashboard
Note
During the first minute or two, there may be a few warnings that surface. Due to Kubernetes reconciliation, all errorsshould resolve by minute three or four.
- Install
kind
.go install sigs.k8s.io/kind@latestsudo install"$(go env --json| jq -r".GOPATH")/bin/kind" /usr/local/bin
- Create a cluster via
kind
.kind create cluster --config"configuration.yaml"kubectl config set-context"$(printf"%s-kind""kind")"
- Unable node(s).
kubectl label node kind-control-plane node.kubernetes.io/exclude-from-external-load-balancers-
- Setup a local load-balancer (within its own private terminal session).
go install sigs.k8s.io/cloud-provider-kind@latestsudo install"$(go env --json| jq -r".GOPATH")/bin/cloud-provider-kind" /usr/local/bincloud-provider-kind -v 9
- Verify connectivity to the cluster.
- If using OpenLens, select the
kind-kind
context.
- If using OpenLens, select the
- Bootstrap.
flux bootstrap github --repository"https://github.com/x-ethr/cluster-management" \ --owner"x-ethr" \ --private"false" \ --personal"false" \ --path"clusters/local" \ --verbose
- Requires a validGitHubpersonal access tokenset as environment variables:
GITHUB_TOKEN
. - For users outside the
x-ethr
organization, fork, import, or copythehttps://github.com/x-ethr/cluster-management repository; or use a customized Flux GitOps project.
- Requires a validGitHubpersonal access tokenset as environment variables:
- Sync local cluster repository's
vendors
.git submodule update --remote --recursive
- Add
kustomization.yaml
to new cluster directory (only applicable during first-time cluster setup).cat<<EOF > ./vendors/cluster-management/clusters/local/kustomization.yamlapiVersion: kustomize.config.k8s.io/v1beta1kind: Kustomizationresources: []EOF
- Optionally, update the
Kustomization.flux-system.spec.interval
(changes each time a local cluster is bootstrapped). - Push local changes to
vendors
submodules.git submodule foreach"git add . && git commit --message\"Git Submodule Update(s)\" && git push -u origin HEAD:main"
- Start the local registry.
bash ./scripts/registry.bash
- Wait for the various resources to reconcile successfully.
The following command will port-forward the gateway's configured port80
and expose it onlocalhost:8080
.
kubectl port-forward --namespace development services/gateway 8080:80
In order to view tracing and network traffic, issue the following command(s):
foriin$(seq 1 250);do curl"http://localhost:8080/v1/test-service-1" curl"http://localhost:8080/v1/test-service-2" curl"http://localhost:8080/v1/test-service-2/alpha" curl"http://localhost:8080/v1/authentication"done
The following command will expose thekiali
service and open a browser to its dashboard.
istioctl dashboard kiali
The following command will expose thejaeger
service and open a browser to its dashboard.
istioctl dashboard jaeger
Usefulistoctl
command(s)
kubectl -n istio-system logs --since=1h istiod-6bc5bc58b4-wvhmc --follow
Usefulkubectl
command(s)
Logging
kubectl --namespace caching logs --since=10m services/redis --follow
Usefulredis-cli
command(s)
redis-cli
Add consumer to consumer group
xadd demo-stream* name john email jdoe@test.comxadd demo-stream* tom tom@test.com
Please see theContributing Guide file for additional details.
kubectl get --namespace istio-system svc/ingress-gateway -o=jsonpath='{.status.loadBalancer.ingress[0].ip}'
Restart the Istio API Gateway Deployment
About
Kind Cluster Bootstrap + GitOps - Used for Local Kubernetes Development and Testing
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.