Define application defaults

This topic describes how you set the application-specific default runtime configuration.

Before you begin

Before you define application defaults, you must have a ContainerApp for your application. Create a ContainerApp by running:

tanzu app init

Set your application’s default number of replicas

  • To set or change the default number of app replicas per Space replica (Availability Target), run:

    tanzu app config scale set --app=<APP-NAME> replicas=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 replica count, run:

    tanzu app config scale delete --app=<APP-NAME> replicas
    

Set your application’s default CPU and memory limits

  • 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
    

Add, update, or remove non-secret environment variables

  • 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
    

Add or remove accepted service bindings

  • 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>
    
check-circle-line exclamation-circle-line close-line
Scroll to top icon