📝(tilt) upgrade tilt doc
upgrade tilt doc by remove sops-related topics + adding linux instructions
This commit is contained in:
committed by
Marie
parent
f23f1eabd6
commit
11c7af205b
@@ -5,6 +5,8 @@ Tilt is a tool that helps you develop applications for Kubernetes.
|
|||||||
It watches your files for changes, rebuilds your containers, and restarts your pods.
|
It watches your files for changes, rebuilds your containers, and restarts your pods.
|
||||||
It's like having a conversation with your cluster.
|
It's like having a conversation with your cluster.
|
||||||
|
|
||||||
|
This is particularly useful when working on integrations or to test your helm charts.
|
||||||
|
Otherwise, you can use your good old docker configuration as described in README.md.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -19,107 +21,49 @@ This guide assumes you have the following tools installed:
|
|||||||
* [helm](https://helm.sh/docs/intro/install/)
|
* [helm](https://helm.sh/docs/intro/install/)
|
||||||
* [helmfile](https://github.com/helmfile/helmfile)
|
* [helmfile](https://github.com/helmfile/helmfile)
|
||||||
* [secrets](https://github.com/jkroepke/helm-secrets/wiki/Installation)
|
* [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.
|
|
||||||
|
|
||||||
|
[Install_prereq script](https://github.com/numerique-gouv/dk8s/blob/main/scripts/install-prereq.sh) (not tested).
|
||||||
|
|
||||||
### Helmfile in Docker
|
### 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
|
```bash
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
docker run --rm --net=host \
|
docker run --rm --net=host \
|
||||||
-v "${HOME}/.kube:/root/.kube" \
|
-v "${HOME}/.kube:/root/.kube" \
|
||||||
-v "${HOME}/.config/helm:/root/.config/helm" \
|
-v "${HOME}/.config/helm:/root/.config/helm" \
|
||||||
-v "${HOME}/.config/sops/age/:/helm/.config/sops/age/" \
|
|
||||||
-v "${HOME}/.minikube:/${HOME}/.minikube" \
|
-v "${HOME}/.minikube:/${HOME}/.minikube" \
|
||||||
-v "${PWD}:/wd" \
|
-v "${PWD}:/wd" \
|
||||||
-e KUBECONFIG=/root/.kube/config \
|
-e KUBECONFIG=/root/.kube/config \
|
||||||
--workdir /wd ghcr.io/helmfile/helmfile:v0.150.0 helmfile "$@"
|
--workdir /wd ghcr.io/helmfile/helmfile:v0.150.0 helmfile "$@"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Create the kubernetes cluster
|
||||||
## Getting started
|
|
||||||
|
|
||||||
### Create the kubernetes cluster
|
|
||||||
|
|
||||||
Run the following command to create a kubernetes cluster using kind:
|
Run the following command to create a kubernetes cluster using kind:
|
||||||
|
|
||||||
```bash
|
|
||||||
./bin/start-kind.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
**or** run the equivalent using the makefile
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make start-kind
|
make start-kind
|
||||||
```
|
|
||||||
|
|
||||||
### [Optional] Install the secret
|
# import your secrets from credentials manager
|
||||||
|
# ! don't forget "https" before your url
|
||||||
You don't need to do this if you are running the stack with keycloak.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make install-external-secrets
|
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
|
|
||||||
```
|
|
||||||
|
|
||||||
That's it! You should now have a local development environment for Kubernetes.
|
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
|
## Start the application
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# You can either start :
|
||||||
|
# ProConnect stack (but secrets must be set on your local cluster)
|
||||||
|
make tilt-up
|
||||||
|
|
||||||
|
# or standalone environment with keycloak
|
||||||
|
make start-tilt-keycloak
|
||||||
|
```
|
||||||
|
|
||||||
|
Access your application at https://desk.127.0.0.1.nip.io
|
||||||
|
|
||||||
## Management
|
## Management
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user