This repository deploys a demo backend app in raw kubernetes object yaml files, using helm chart, and using kustomization. And discuss their differences. One can use this as a starting point to:
- Learn helm chart.
- Lean kustomization.
- Learn the differences between them.
- k3d: we use this to provision a k8s cluster as playground.
- just: our project command line interface (similar to
make
but much better).
cd demo-backend
just build
Our backend service has an api /status
, and can be built in demo-backend
folder with just build
. The api detect ENV
's value and return different response accordingly.
- When
ENV
isdev
or is missing, it returns{"status":"ok", "ENV":"dev", "cpu":0.4, "memory_usage":2243194880}
- When
ENV
is notdev
, it returns{"status":"ok","ENV":"actual env value"}
- Deploy with
just install
. curl 127.0.0.1:8080/status
to check for result.- Manually update the
deployment.yaml
'sENV
value. - Redeploy with
just install
. curl 127.0.0.1:8080/status
to check for result change.
Takeaways
- Requires manually updating in a complicated yaml file.
- Requires updating multiple location if we decide to change some shared value like port.
- Not clear to our user which values are expose for customization.
- Deploy with
just install
curl 127.0.0.1:8080/status
to check for result.- Manually update the
values.yaml
'sENV
value. - Upgrade helm installation with
just upgrade
. curl 127.0.0.1:8080/status
to check for result change.
Takeaways
- Much more convenient to change common values through
values.yaml
. - Still has difficulty manage different deployment's specific settings.
- Can't use different branch, as it is not friendly for continuous development.
- Deploy with
just install prod
curl 127.0.0.1:8080/status
to check for result.just uninstall prod
just install dev
curl 127.0.0.1:8080/status
to check for result change.
Takeaways
- Much more convenient to maintain settings for different deployments.
- lack the
helm
like installation management function (version control, rollback, ...etc).
- To be continued...