VMware Telco Cloud Automation (TCA) lets users set log retention limits based on log age and size. The system cleans up logs every midnight and any changes in configuraton takes effect the next day.
Configuring the number of days the logs will be retained in the TCA appliance
Log retention is measured in days. If set to 3, logs are kept for 3 days. The minimum value is 1, and only whole numbers are allowed.
- ssh as admin user to TCA appliance.
- Run the following command to edit configmap:
kubectl edit configmap -n $NAMESPACE tca-retained-log-cleanup-config
NAMESPACE can be either be
tca-mgr
ortca-cp-cn
depending on the appliance. - In the configmap, navigate to data, then retained-log-cleanup-config.yaml, and add a value to the days_to_keep field. Example:
days_to_keep: 10
will retain the logs for 10 days. - To review the change, run the following command:
kubectl get configmap -n $NAMESPACE tca-retained-log-cleanup-config -oyaml
Note: This value will be applied to all the pod logs. For example, if the log retention threshold is set to 10 days, logs older than 10 days will be cleaned for each pod.
Configuring the upper limit and lower limit for logs sizes
Log retention size is measured in KB. To set the maximum log size for each pod to 10MB, enter value as 10000. The minimum value for both the upper and the lower limits is 1, the upper limit must be greater than or equal to the lower limit.
- ssh as admin user to the TCA appliance.
- Run the command below to edit configmap:
kubectl edit configmap -n $NAMESPACE tca-retained-log-cleanup-config
NAMESPACE can either be
tca-mgr
ortca-cp-cn
, depending on the appliance. - In the configmap, navigate to Data, then retained-log-cleanup-config.yaml. Change the values of upper_limit_per_pod and lower_limit_per_pod fields. For example, to cleanup when the maximum size of the logs is over 100MB and delete until size is less than 70MB, the values should be upper_limit_per_pod: 100000 and lower_limit_per_pod: 70000.
- To review the change, run the following command:
kubectl get configmap -n $NAMESPACE tca-retained-log-cleanup-config -oyaml
Note: Upper limit and lower limit will be applied on logs of each pod. For example, if upper limit is set to 500KB and lower limit set to 300KB, logs of any pods exceeding 500KB will be cleaned till it is less than 300KB.