- Notifications
You must be signed in to change notification settings - Fork1
ytt (https://github.com/k14s/ytt) library that includes reusable K8s components (app, ...)
License
carvel-dev/ytt-library-for-kubernetes
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
!!! Must use ytt v0.23.0+ !!!
carvel-ytt-library-for-kubernets
is aytt library that includes reusable K8s components.
app
library builds apps that consist of Deployment, Service, Ingress and HPA. More specifically:
- Ingress is configured with
/
path and points to a Service which points to a Deployment - Deployment configures Pod anti affinity based on node hostname
- Deployment by default has 1 Pod replica
- HPA scales Pods between 1 to 10, aiming for target avg. CPU util. of 50
- kapp's Config that picks up Deployment's
spec.replica
value from the server (set by HPA) instead of local copy
Examples:
- app.yml: App that only requires Docker image configuration
- app-with-volumes.yml: App that uses ConfigMap volume
- app-with-overlay.yml: App that customizes Ingress to force SSL redirection
To make a simple app that uses k8s-lib:
$ mkdir my-app&&cd my-app$ git clone https://github.com/vmware-tanzu/carvel-ytt-library-for-kubernetes _ytt_lib/github.com/vmware-tanzu/carvel-ytt-library-for-kubernetes$# create `config.yml` with below contents$ ytt -f.
config.yml
contents:
#@ load("@ytt:template", "template")#@ load("@ytt:library", "library")#@ def config(port=80):name:helloport:#@ port#@overlay/replacecontainer:image:hashicorp/http-echoargs: -#@ "-listen=:" + str(port) --text="hello!"#@ end#@ app = library.get("github.com/vmware-tanzu/carvel-ytt-library-for-kubernetes/app").with_data_values(config())---#@ template.replace(app.eval())
Example output can be seenhere.
nsa
library creates service accounts that are scoped to a particular namespace.
Examples:
- nsa.yml: Creates three tenants. Each tenant has a service account with full privileges within their namespace.
Useful for generating kubeconfig based on set of credentials. Convenient when authenticating to GKE with basic auth credentials:
ytt -f kubeconfig/ -v username=admin -v password=foobar \ -v address=xx.xx.xx.xx --data-value-file ca_cert=<(pbpaste)>~/.kube/dk-jan-9
Carvel 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 ourCarvel 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
./hack/test.sh
test.sh executes all templates inexamples/
.
About
ytt (https://github.com/k14s/ytt) library that includes reusable K8s components (app, ...)
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.