This topic tells you how you set application-specific default runtime configuration on Tanzu Platform for Kubernetes.
Before you define application defaults, you must have a ContainerApp for your application. Create a ContainerApp by running:
tanzu app init
To set or change the default number of app instances per Space replica (Availability Target), run:
tanzu app config scale set --app=<APP-NAME> instances=10
Where <APP-NAME>
references the ContainerApp name defined in tanzu app init
. This argument is optional and defaults to the ContainerApp at the root of your current working directory if no app name is passed.
To delete your application’s default instance count, run:
tanzu app config scale delete --app=<APP-NAME> instances
To set or change your application’s default CPU limit in each Space replica (Availability Target), run:
tanzu app config scale set --app=<APP-NAME> cpu=10
To delete your application’s default CPU limit, run:
tanzu app config scale delete --app=<APP-NAME> cpu
To set or change your application’s default memory limit in each Space replica (Availability Target), run:
tanzu app config scale set --app=<APP-NAME> memory=500M
To delete your application’s default memory limit, run:
tanzu app config scale delete --app=<APP-NAME> memory
To set or change non-secret environment variables, run:
tanzu app config env set --app=<app-name> KEY=VALUE
To delete a non-secret environment variable, run:
tanzu app config env delete --app=<app-name> KEY
To add an accepted service binding, run:
tanzu app config servicebinding set --app=<app-name> <service-binding-type>=<service-binding-name>
For example, to add an AcceptedServiceBindg
for a mysql
type service named my-db
:
tanzu app config servicebinding set --app=my-app mysql=my-db
To delete an accepted service binding, run:
tanzu app config servicebinding delete --app=<app-name> <service-binding-type>
To get details about the local configuration of an application, run:
tanzu app config get --app=<app-name>