Use this repo as an example for organizing ytt templates for your application.
config/
contains files describing app configurationconfig-env/
contains environment configuration filesDockerfile
-
Obtain and target a Kubernetes Cluster.
-
Deploy the application to the cluster:
$ ytt -f config/ -f config-env/production.yml | kubectl apply -f - deployment.apps/greeter created service/greeter created configmap/greeter created
Note: The values from
config/
are applied first and the production values fromconfig-env/
will override them. -
Forward local traffic to the cluster in order to visit the app:
$ kubectl port-forward service/greeter 8080:8080 Forwarding from 127.0.0.1:8080 -> 80 Forwarding from [::1]:8080 -> 80
-
Verify the deployment
$ curl localhost:8080/app/