|
| 1 | +# Test Locally |
| 2 | + |
| 3 | +**Warning!** This test is for those who have access to `helm-charts-priv`. |
| 4 | + |
| 5 | +## Run and check cluster |
| 6 | + |
| 7 | +1. Create and run a cluster if it is not running yet. |
| 8 | + |
| 9 | +```shell |
| 10 | +git clone https://github.com/openmfp/helm-charts-priv.git |
| 11 | +cd helm-charts-priv |
| 12 | +task local-setup |
| 13 | +``` |
| 14 | + |
| 15 | +2. Verify that the cluster is running. |
| 16 | + |
| 17 | +Run k9s, go to `:pods`. All pods must have a status of "Running". |
| 18 | +It may take some time before they are all ready. The possible issues may be insufficient RAM and/or CPU cores. In this case, increase the limits in Docker settings. |
| 19 | + |
| 20 | +3. In k9s, go to `:pods`, then open pod `kubernetes-graphql-gateway-...`. |
| 21 | + |
| 22 | +Open container `kubernetes-graphql-gateway-gateway` to see the logs. |
| 23 | +The logs must contain more than a single line (with "Starting server..."). |
| 24 | +If you see only this single line, the problem might be in the container called "kubernetes-graphql-gateway-listener". |
| 25 | + |
| 26 | +Note the `IMAGE` column, corresponding to the two `kubernetes-...` container. It contains the name and the currently used version of the build, i.e. |
| 27 | +``` |
| 28 | +ghcr.io/openmfp/kubernetes-graphql-gateway:v0.75.1 |
| 29 | +``` |
| 30 | + |
| 31 | +4. Build the Docker image: |
| 32 | +```shell |
| 33 | +task docker |
| 34 | +``` |
| 35 | + |
| 36 | +5. Tag the newly built image with the version used in local-setup -- that image is going to be replaced with the one built on step 4. |
| 37 | +```shell |
| 38 | +docker tag ghcr.io/openmfp/kubernetes-graphql-gateway:latest ghcr.io/openmfp/kubernetes-graphql-gateway:v0.75.1 |
| 39 | +``` |
| 40 | +Use the name you and version got from the `IMAGE` column on step 3. Leave the version number unchanged. |
| 41 | + |
| 42 | +6. Check your cluster name: |
| 43 | +```shell |
| 44 | +kind get clusters |
| 45 | +``` |
| 46 | +In this example, the cluster name is `openmfp`. |
| 47 | + |
| 48 | +7. Load the new image into your kind cluster: |
| 49 | +***Docker-based kind:*** |
| 50 | +```shell |
| 51 | +kind load docker-image ghcr.io/openmfp/kubernetes-graphql-gateway:v0.75.1 -n openmfp |
| 52 | +``` |
| 53 | +The argument `-n openmfp` is to change the default value of the cluster name, which is `kind`. |
| 54 | + |
| 55 | +***Podman-based kind:*** |
| 56 | +- Pull (or build) the image locally with Podman: |
| 57 | +```shell |
| 58 | +podman pull ghcr.io/openmfp/kubernetes-graphql-gateway:v0.75.1 |
| 59 | +``` |
| 60 | + |
| 61 | +- Save it to a tarball in OCI-archive format: |
| 62 | +```shell |
| 63 | +podman save --format oci-archive ghcr.io/openmfp/kubernetes-graphql-gateway:v0.75.1 -o kubernetes-graphql-gateway_v0.75.1.tar |
| 64 | +``` |
| 65 | + |
| 66 | +- Load the tarball into your Podman-backed kind cluster: |
| 67 | +```shell |
| 68 | +kind load image-archive kubernetes-graphql-gateway_v0.75.1.tar -n openmfp |
| 69 | +``` |
| 70 | + |
| 71 | +8. In k9s, go to `:pods` and delete the pod (not the container) called `kubernetes-graphql-gateway-...`. |
| 72 | + |
| 73 | +Kubernetes will immediately recreate the pod -- but this time it will use the new version of the build. |
| 74 | + |
| 75 | +9. Once the pod is recreated, go to [https://portal.dev.local:8443](https://portal.dev.local:8443) |
| 76 | +and check if everything works fine. |
0 commit comments