Skip to content

Commit

Permalink
📝(tilt) upgrade tilt doc
Browse files Browse the repository at this point in the history
upgrade tilt doc by remove sops-related topics +
adding linux instructions
  • Loading branch information
mjeammet committed Feb 4, 2025
1 parent 579dbde commit 7c0d6e0
Showing 1 changed file with 6 additions and 74 deletions.
80 changes: 6 additions & 74 deletions docs/local_development_kube.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,116 +10,48 @@ It's like having a conversation with your cluster.

This guide assumes you have the following tools installed:

- [brew](https://brew.sh/) if you are on linux
- [Docker](https://docs.docker.com/get-docker/)
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
* [mkcert](https://github.com/FiloSottile/mkcert)
* [mkcert](https://github.com/FiloSottile/mkcert)
- [ctlptl](https://github.com/tilt-dev/ctlptl)
- [Tilt](https://docs.tilt.dev/install.html)
* [helm](https://helm.sh/docs/intro/install/)
* [helmfile](https://github.com/helmfile/helmfile)
* [secrets](https://github.com/jkroepke/helm-secrets/wiki/Installation)
* [sops](https://github.com/getsops/sops)


### SOPS configuration

**Generate a SOPS key**

For this specific step you need to have the `age-keygen` tool installed.
See https://github.com/FiloSottile/age.
Then generate a key:

```bash
age-keygen -o my-age.key
```

**Install the SOPS key**

Read the SOPS documentation on how to install the key in your environment.
https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age

On Ubuntu it's like:

```bash
mkdir -p ~/.config/sops/age/
cp my-age.key ~/.config/sops/age/keys.txt
chmod 400 ~/.config/sops/age/keys.txt
```

**Add the SOPS key to the repository**

Update the [.sops.yaml](../.sops.yaml) file with the **public** key id you generated.


### Helmfile in Docker

If you use helmfile in Docker, you may need an additional configuration to make
it work with you age key.

You need to mount `-v "${HOME}/.config/sops/age/:/helm/.config/sops/age/"`

```bash
#!/bin/sh

docker run --rm --net=host \
-v "${HOME}/.kube:/root/.kube" \
-v "${HOME}/.config/helm:/root/.config/helm" \
-v "${HOME}/.config/sops/age/:/helm/.config/sops/age/" \
-v "${HOME}/.minikube:/${HOME}/.minikube" \
-v "${PWD}:/wd" \
-e KUBECONFIG=/root/.kube/config \
--workdir /wd ghcr.io/helmfile/helmfile:v0.150.0 helmfile "$@"
```


## Getting started

### Create the kubernetes cluster

Run the following command to create a kubernetes cluster using kind:

```bash
./bin/start-kind.sh
```

**or** run the equivalent using the makefile

```bash
make start-kind
```

### [Optional] Install the secret
### Install the secret

You don't need to do this if you are running the stack with keycloak.
You might not need to do this if you are run the stack with keycloak.

```bash
make install-external-secrets
```

### Deploy the application

```bash
# Pro Connect environment
tilt up -f ./bin/Tiltfile

# Standalone environment with keycloak
DEV_ENV=dev-keycloak tilt up -f ./bin/Tiltfile
```

**or** run the equivalent using the makefile

```bash
# Pro Connect environment
make tilt-up

# Standalone environment with keycloak
make tilt-up-keycloak
make start-tilt-keycloak
```

That's it! You should now have a local development environment for Kubernetes.

You can access the application at https://desk.127.0.0.1.nip.io
Wait for front-end image to build and you can access the application at https://desk.127.0.0.1.nip.io (it can take up to a few minutes)

## Management

Expand Down

0 comments on commit 7c0d6e0

Please sign in to comment.