Skip to main content

Upgrade

To upgrade Kubernetes UniAgent, take the following steps:

Step 1. Back up the old version of tingyunagent.yaml.

Since the old yaml may have performed scaling on the collector, or may have set special configurations for some applications via pod-init.sh, you should first back up the old version of tingyunagent.yaml for reference, and modify the new yaml accordingly.

Step 2. Upload to the private image repository.

If you are using a private image repository, upload the private image of the version to be upgraded. If you are using the Docker official public repository, skip this step.

Step 3. Generate a new version of tingyunagent.yaml via the platform.

The Cluster Name and Namespace must be consistent with the parameters used to generate the old yaml.

Note: If you are not sure about the original cluster name, check the idc_name configuration item in tingyun-common.yaml in the configMap named tingyun-common-config in the old yaml.

Step 4. Modify the new tingyunagent.yaml according to the old yaml.

  • Replace cluster_id and apm_aggressive in tingyun-common.yaml from the old yaml into the new yaml.
  • If the collector was scaled (replicas > 1), modify the collector replica count in the new yaml.
  • If you modified pod-init.sh in tingyun-injector-config in the old yaml, add the changes to pod-init.sh in tingyun-injector-config in the new yaml.
  • If you modified the policy.yaml limit strategy in tingyun-injector-config in the old yaml, add the changes to policy.yaml in tingyun-injector-config in the new yaml.
  • If you are upgrading from version 2.4.0 or below to 2.4.1 or above, because the service name of the deployed collector has changed, after applying the new yaml, you need to promptly restart the application pods that have already been injected. If you cannot restart all application pods in time, add the following content to the new tingyunagent.yaml to minimize monitoring data loss.
---
apiVersion: v1
kind: Service
metadata:
name: tingyun-collector
namespace: tingyun
spec:
selector:
vendor: tingyun
component: collector
ports:
- name: apm
protocol: TCP
port: 7665
targetPort: 7665
- name: infra
protocol: TCP
port: 7666
targetPort: 7666
sessionAffinity: ClientIP
clusterIP: None

Step 5. Apply the yaml.

  • Run kubectl delete -f old tingyunagent.yaml to delete the old resources.

  • Run kubectl apply -f new tingyunagent.yaml to create the new resources.