https://github.com/pnxtech/local-k8s
Local Kubernetes cluster for use with Windows/Mac under Docker Desktop
https://github.com/pnxtech/local-k8s
Last synced: 7 months ago
JSON representation
Local Kubernetes cluster for use with Windows/Mac under Docker Desktop
- Host: GitHub
- URL: https://github.com/pnxtech/local-k8s
- Owner: pnxtech
- Created: 2022-08-08T02:40:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T02:32:38.000Z (over 3 years ago)
- Last Synced: 2025-04-11T04:06:08.527Z (9 months ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# local-k8s
Local Kubernetes Cluster
This repo is design to enable a Kubernetes cluster environment for use in development.
The cluster hosts services such as a single instance of Redis and MongoDB.
## Machine setup
### Docker Desktop
This Kubernetes setup relies on an installation of [Docker Desktop]() . Once installed make sure to enable Kubernetes on the Docker Desktop dashboard.
## Cluster Setup
Execute the one time init script. Optionally, include the `local_cluster_host` argument pointed at your ngrok origin, ie: https://some-unique-subdomain.ngrok.io. But all other arguments are required to run the init script.
Usage:
```shell
$ ./one-time-init.sh \
--local_cluster_host localk8s.ngrok.io \
--docker_username \
--docker_password "" \
--docker_email \
--github_token
```
For ease, copy the command above into init.sh and execute it. The `init.sh` is automatically excluded from github and may be deleted after use.
## Starting and stopping the Local K8s cluster
### On MacOS
Starting:
```sh
./startup.sh
```
Stopping:
```sh
./shutdown.sh
```
### On Windows
Starting:
```sh
.\startup.ps1
```
Stopping:
```sh
.\shutdown.ps1
```
## Access local gateway rouer
```
{sudo} kubectl port-forward --address 0.0.0.0 service/hydra-router-cluster-ip-service 80:5353
kubectl port-forward --address 0.0.0.0 service/redis-cluster-ip-service 6379:6379
```
## Optional: using ngrok
```
./ngrok.exe http --subdomain=cjus 80
```
## Use of Redis
This repo uses RedisStack to enable a local Redis server. It's highly recommended that you consider using RedisInsight to access the Redis Service.
Download a version for your OS: https://redis.io/docs/stack/insight/#download-the-latest-redisinsight