Explore k14s
What is k14s
k14s has been renamed to Carvel.
Lab 1
- Install Carvel tool
- Define the ytt template & values for cow say app
- Build the ytt template to be OCI image
- Using
App
from kapp-controller to deploy the cow say app
Install Carvel tool
The official Carvel page has the installation guide: link
brew tap k14s/tap
brew install ytt kbld kapp imgpkg kwt vendir
Create the ytt template and values
Build the ytt template by using docker
docker build -f Dockerfile -t danielguo/cow-say-template:v1 .
docker push danielguo/cow-say-template:v1
Deploy cow say app
- Switch to root dir of this project
- Install kapp-controller:
kubectl apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml
- Create RBAC for kapp-controller. Link to the Yaml
- Create Secret which contains the cow say ytt template values.
kubectl create secret generic cow-say-value --from-file=values.yaml=./ytt/values.yaml
- Create App CR for cow-say app Link to the Yaml
-
Double check the deployed app
kapp list Target cluster 'https://127.0.0.1:32776' (nodes: kind-control-plane) Apps in namespace 'default' Name Namespaces Lcs Lca cow-say-app-ctrl default true 22s Lcs: Last Change Successful Lca: Last Change Age 1 apps Succeeded
- Enable port forwarding and access the app
kubectl port-forward service/cow-say 8081:1323
-
Curl to the app endpoint
curl localhost:8081 _______ < Hello > ------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||%
Lab 2
Explore the apply order from kapp: https://github.com/vmware-tanzu/carvel-kapp/blob/develop/docs/apply-ordering.md
- Install kapp-controller
kubectl apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml
- Deploy the app in order(the order is specified by the annotation from workload-bundle.yaml)
kapp deploy -a cow-say -f ./lab-2/artifacts/workload-bundle.yaml
References
- https://tanzu.vmware.com/content/blog/introducing-k14s-kubernetes-tools-simple-and-composable-tools-for-application-deployment
- https://github.com/vmware-tanzu/carvel-ytt/blob/develop/docs/faq.md
- https://github.com/vmware-tanzu/carvel-ytt/blob/develop/docs/lang-ref-ytt.md
- https://github.com/vmware-tanzu/carvel-kapp-controller/blob/develop/docs/app-spec.md