In Kubernetes, you can attach metadata to application pods by configuring annotations. This helps store additional information and facilitates query of information by using tools and libraries without affecting pod running. Annotation values support both structured and unstructured data and can contain characters that are not allowed in tags. This topic describes how to attach non-identity metadata to an application when you deploy the application.
Procedure
Log on to the EDAS console.
In the left-side navigation pane, click . In the top navigation bar, select a region. In the upper part of the page, select a namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, find the application that you want to deploy and click the application name.
In the upper-right corner of the Application Overview page, choose .
On the Select Deployment Mode page, select a deployment mode and click Start Deployment in the upper-right corner of the deployment mode section.
NoteIn this example, Release to All at Once is used.
On the Release to All at Once page, modify deployment parameters based on your business requirements and click Annotation Configuration to configure key-value pairs. Then, click OK.
Sample annotation:
Set Name to
demo-annotation
.Set Value to
demo-annotation-value
.
After the application is deployed, run the following kubectl command to query the annotation configurations of the application:
kubectl get pod
In the command output, the demo-annotation: demo-annotation-value key-value pair appears in the metadata.annotations field of the application pod.
References
For information about other parameters that are used when you create or deploy an application, see Create a Kubernetes application by using the default application source.