在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):vmware-tanzu/carvel-simple-app-on-kubernetes开源软件地址(OpenSource Url):https://github.com/vmware-tanzu/carvel-simple-app-on-kubernetes开源编程语言(OpenSource Language):Shell 50.4%开源软件介绍(OpenSource Introduction):k8s-simple-app-exampleExample repo shows how to use tools from carvel dev: ytt, kbld, kapp and kwt to work with a simple Go app on Kubernetes. Associated blog post: Deploying Kubernetes Applications with ytt, kbld, and kapp. Install Carvel ToolsHead over to carvel.dev for installation instructions. Deploying ApplicationEach top level step has an associated Step 1: Deploying applicationIntroduces kapp for deploying k8s resources. kapp deploy -a simple-app -f config-step-1-minimal/
kapp inspect -a simple-app --tree
kapp logs -f -a simple-app Step 1a: Viewing applicationOnce deployed successfully, you can access frontend service at kubectl port-forward svc/simple-app 8080:80 You will have to restart port forward command after making any changes as pods are recreated. Alternatively consider using kwt which exposes cluser IP subnets and cluster DNS to your machine and does not require any restarts: sudo -E kwt net start and open Step 1b: Modifying application configurationModify kapp deploy -a simple-app -f config-step-1-minimal/ --diff-changes In following steps we'll use Step 2: Configuration templatingIntroduces ytt templating for more flexible configuration. kapp deploy -a simple-app -c -f <(ytt -f config-step-2-template/) ytt provides a way to configure data values from command line as well: kapp deploy -a simple-app -c -f <(ytt -f config-step-2-template/ -v hello_msg=another-stranger) New message should be returned from the app in the browser. Step 2a: Configuration patchingIntroduces ytt overlays to patch configuration without modifying original kapp deploy -a simple-app -c -f <(ytt -f config-step-2-template/ -f config-step-2a-overlays/custom-scale.yml) Step 2b: Customizing configuration data values per environmentRequires ytt v0.13.0+. Introduces use of multiple data values to show layering of configuration for different environment without modifying default kapp deploy -a simple-app -c -f <(ytt -f config-step-2-template/ -f config-step-2b-multiple-data-values/) Step 3: Building container images locallyIntroduces kbld functionality for building images from source code. This step requires Minikube. If Minikube is not available, skip to the next step. eval $(minikube docker-env)
kapp deploy -a simple-app -c -f <(ytt -f config-step-3-build-local/ | kbld -f-) Note that rerunning above command again should be a noop, given that nothing has changed. Step 3a: Modifying application source codeUncomment kapp deploy -a simple-app -c -f <(ytt -f config-step-3-build-local/ | kbld -f-) Observe that new container was built, and deployed. This change should be returned from the app in the browser. Step 4: Building and pushing container images to registryIntroduces kbld functionality to push to remote registries. This step can work with Minikube or any remote cluster. docker login -u dkalinin -p ...
kapp deploy -a simple-app -c -f <(ytt -f config-step-4-build-and-push/ -v push_images_repo=gcr.io/projectX/k8s-simple-app | kbld -f-) Step 5: Clean up cluster resourceskapp delete -a simple-app There is currently no functionality in kbld to remove pushed images from registry. Directory Layout
Join the Community and Make Carvel BetterCarvel is better because of our contributors and maintainers. It is because of you that we can bring great software to the community. Please join us during our online community meetings. Details can be found on our Carvel website. You can chat with us on Kubernetes Slack in the #carvel channel and follow us on Twitter at @carvel_dev. Check out which organizations are using and contributing to Carvel: Adopter's list |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论