Dev Setup
Please have a look the sequence diagrams in components_diagrams
folder to learn more about the high level design of this project.
Pre-requisites
- Docker
- Local k8 cluster using any of the following tools:
- cloudflared for port forwarding
- kubectl to manage the local cluster.
- Make the build automation tool - most likely you will already have it but just in case.
- Golang
- Earthly
Steps
- Local cluster: minikube/k3d/kind
- If required to start a new cluster using config, you can do it using the
k8s/mock2/clusterWithWebhookRegistration/kinDCluster.yaml
- If required to start a new cluster using config, you can do it using the
- Build the postgres sidecar image by running
make build-sidecars
Running local
- Store the cluster config at
~/.kube/config
- Start cloudflared tunnel
make tunnel-adm-controller
and get the tunnel url from output file - Update the URL in
k8s/mock2/mutating-webhook.yaml
- Apply
k8s/mock2/mutating-webhook.yaml
using kubectl on your local cluster - Start the operators and adm_controller through
make run
- At this point, you should be able to see these components created on the cluster (you can use lens for that)
- Try experimenting and user flows by applying manifests in
k8s/mock2
to see things in action :)
Running as chart
- Start cloudflared tunnel
make tunnel-icp
and get the tunnel url: - Update the URL in
tororu-operator
helm chart values, underconfig.icpNodeUrl
- Update the canister id in
tororu-operator
helm chart values, underconfig.canisterId
- Start the operators and adm_controller through
make install-chart
- Try experimenting and user flows by applying manifests in
k8s/mock2
to see things in action :)
Demo
To run a complete demo, please follow these steps after you finish the previous setup.
Option A: Using manifests
- Create a tororu resource:
- Run
kubectl apply -f k8s/mock2/tororu-api/tororu-crd.yaml
- Check the result under Custom Resources on lens
- Run
- Create two new CRDs:
- Prateek's secret:
kubectl apply -f k8s/mock2/postgres-crd-1.yaml
- Juan's secret:
kubectl apply -f k8s/mock2/postgres-crd-2.yaml
- Prateek's secret:
Option B: Using helm charts
- Create a tororu resource, deploying two new CRDs:
- Run
make install-crds
- Check the result under Custom Resources on lens
- Run
Creating RW and RO consumers
- Create a pvc
kubectl apply -f k8s/mock2/persistantVolume.yaml
- Deploy the postgres server
kubectl apply -f k8s/mock2/postgres-server.yaml
- Deploy the postgres client
kubectl apply -f k8s/mock2/postgres-client.yaml