A small web application running microservices inside k8s cluster.
kubectl
CLI- Docker desktop with kubernetes installed
- Create a new k8s cluster using
docker-desktop
context:
kubectl config get-contexts
kubectl config use-context docker-desktop
- Get
ingress-nginx
controller up and running.
Example (the YAML config might change, refer to the installation guide above):
cd k8s
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/cloud/deploy.yaml
- Install
skaffold
CLI for easier development - Tweak
hosts
file in your computer to redirect traffic from ingress host configuration to your localhost: Example in MacOS:
sudo nano /etc/hosts
Then add the mapping and save. In this example, tickets.dev
is the host for authentication rule of ingress-service
:
127.0.0.1 tickets.dev
- Build a Docker image for
auth
,tickets-client
andtickets
services (if you want to use your own images)
cd auth
docker build -t your_docker_id/auth .
docker push your_docker_id/auth
Same thing could be done for tickets-client
and tickets
.
Note that the image name, your_docker_id/auth
in this case, will be used in e.g. auth-deployment
config.
- Start the development environment:
skaffold dev