Enable ARMS for an ACK Serverless cluster

Updated at: 2025-01-24 06:32

You can use Application Real-Time Monitoring Service (ARMS) to manage Container Service for Kubernetes (ACK) Serverless clusters that are deployed across regions in a unified manner. This topic describes how to enable ARMS for an ACK Serverless Basic cluster.

Table of contents

Prerequisites

An ACK Serverless cluster is created.

Step 1: Install the ARMS application monitoring agent

Before you install the ARMS application monitoring agent, check whether your ACK Serverless cluster has ARMS Addon Token. If the cluster has ARMS Addon Token, ARMS performs passwordless authentication. If the cluster does not have ARMS Addon Token, you need to manually specify the AccessKey ID and AccessKey secret to complete authentication.

Check whether ARMS Addon Token exists in a cluster

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters. On the Clusters page, click the name of the cluster to go to the cluster details page.

  2. In the left-side navigation pane, choose Configurations > Secrets. In the upper part of the page, select kube-system from the Namespace drop-down list and check whether addon.arms.token is displayed on the Secrets page.

Procedure

  1. Complete authorization on the Cloud Resource Access Authorization page.

  2. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  3. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose Operations > Add-ons.

  4. On the Add-ons page, click the Logs and Monitoring tab and click Install in the ack-onepilot card.

  5. In the Install ack-onepilot dialog box, configure the parameters and click OK.

    If the ACK Serverless cluster does not have ARMS Addon Token, you need to specify the AccessKey ID and AccessKey secret. You can configure other parameters on demand. We recommend that you use the default settings.

    Parameter

    Description

    Parameter

    Description

    accessKey

    The AccessKey ID of your Alibaba Cloud account. Your account must be authorized to access ARMS.

    accessKeySecret

    The AccessKey secret of your Alibaba Cloud account.

Step 2: Enable ARMS for a Java application

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose Workloads > Deployments.

  3. On the Deployments page, choose More > View in YAML in the Actions column of the deployment that you want to manage.

  4. In the YAML file, add the following labels to spec.template.metadata:

    labels:
      armsPilotAutoEnable: "on"
      armsPilotCreateAppName: "<your-deployment-name>"    # Replace <your-deployment-name> with the actual application name. 
      armsSecAutoEnable: "on"    # If you want to connect the application to Application Security, you must configure this parameter.
    Note
    • To ensure your optimal user experience, after you install the ARMS agent, the ack-onepilot component automatically updates the agent to the latest version when your application restarts, following the release of a new agent version. If you do not want to automatically update the agent with each new release, you can manually control the version. For more information, see Control the agent version.

    • For information about Application Security, see What is Application Security?

    • For more information about the billing rules of Application Security, see Billing.

    YAML Example

    The following YAML template shows how to create a Deployment and enable Application Monitoring for the application.

    YAML template

    apiVersion: v1
    kind: Namespace
    metadata:
      name: arms-demo
    ---
    apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
    kind: Deployment
    metadata:
      name: arms-springboot-demo
      namespace: arms-demo
      labels:
        app: arms-springboot-demo
    spec:
      replicas: 2
      selector:
        matchLabels:
          app: arms-springboot-demo
      template:
        metadata:
          labels:
            app: arms-springboot-demo
            armsPilotAutoEnable: "on"
            armsPilotCreateAppName: "arms-k8s-demo"
        spec:
          containers:
            - resources:
                limits:
                  cpu: 0.5
              image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-springboot-demo:v0.1
              imagePullPolicy: Always
              name: arms-springboot-demo
              env:
                - name: SELF_INVOKE_SWITCH
                  value: "true"
                - name: COMPONENT_HOST
                  value: "arms-demo-component"
                - name: COMPONENT_PORT
                  value: "6666"
                - name: MYSQL_SERVICE_HOST
                  value: "arms-demo-mysql"
                - name: MYSQL_SERVICE_PORT
                  value: "3306"
    ---
    apiVersion: apps/v1 
    kind: Deployment
    metadata:
      name: arms-springboot-demo-subcomponent
      namespace: arms-demo
      labels:
        app: arms-springboot-demo-subcomponent
    spec:
      replicas: 2
      selector:
        matchLabels:
          app: arms-springboot-demo-subcomponent
      template:
        metadata:
          labels:
            app: arms-springboot-demo-subcomponent
            armsPilotAutoEnable: "on"
            armsPilotCreateAppName: "arms-k8s-demo-subcomponent"
        spec:
          containers:
            - resources:
                limits:
                  cpu: 0.5
              image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-springboot-demo:v0.1
              imagePullPolicy: Always
              name: arms-springboot-demo-subcomponent
              env:
                - name: SELF_INVOKE_SWITCH
                  value: "false"
                - name: MYSQL_SERVICE_HOST
                  value: "arms-demo-mysql"
                - name: MYSQL_SERVICE_PORT
                  value: "3306"
    ---
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        name: arms-demo-component
      name: arms-demo-component
      namespace: arms-demo
    spec:
      ports:
        # the port that this service should serve on
        - name: arms-demo-component-svc
          port: 6666
          targetPort: 8888
      # label keys and values that must match in order to receive traffic for this service
      selector:
        app: arms-springboot-demo-subcomponent
    ---
    apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
    kind: Deployment
    metadata:
      name: arms-demo-mysql
      namespace: arms-demo
      labels:
        app: mysql
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: mysql
      template:
        metadata:
          labels:
            app: mysql
        spec:
          containers:
            - resources:
                limits:
                  cpu: 0.5
              image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-demo-mysql:v0.1
              name: mysql
              ports:
                - containerPort: 3306
                  name: mysql
    ---
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        name: mysql
      name: arms-demo-mysql
      namespace: arms-demo
    spec:
      ports:
        # the port that this service should serve on
        - name: arms-mysql-svc
          port: 3306
          targetPort: 3306
      # label keys and values that must match in order to receive traffic for this service
      selector:
        app: mysql
    ---

On the Deployments page, click ARMS Console in the Actions column of the Java application to navigate to the ARMS console and perform service governance.

What to do next

  • Uninstall ack-onepilot for all applications in the cluster

    1. Log on to the ACK console. On the Clusters page, click the name of the cluster.

    2. In the left-side navigation pane, choose Operations > Add-ons. In the search box, enter ack-onepilot.

    3. On the ack-onepilot card, click Uninstall.

    4. In the message that appears, click OK.

    5. Restart your business pod.

  • Uninstall ack-onepilot for an application in the cluster

    1. Log on to the ACK console. In the left-side navigation pane, click Clusters. On the Clusters page, find the cluster, and click Applications in the Actions column.

    2. On the Deployments page, choose More > View in YAML in the Actions column of the application that you want to manage.

    3. In the Edit YAML dialog box, delete the labels that you added in Step 2, and click Update.

    4. Restart the pod.

  • On this page (1)
  • Table of contents
  • Prerequisites
  • Step 1: Install the ARMS application monitoring agent
  • Procedure
  • Step 2: Enable ARMS for a Java application
  • What to do next
  • References
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare