Starting the Amazon AppConfig agent for Amazon EKS integration
The Amazon AppConfig Agent sidecar container is automatically available in your Amazon EKS
environment. To use it, you must start it. The following procedure describes how to use
the Amazon EKS kubectl
command line tool to start the agent.
Note
Before you continue, ensure that your kubeconfig
file is up to date.
For more information about creating or editing a kubeconfig
file, see
Creating
or updating a kubeconfig file for an Amazon EKS cluster in the
Amazon EKS User Guide.
To start Amazon AppConfig Agent (kubectl command line tool)
-
Open the manifest for your application and verify that your Amazon EKS application is running as a single-container deployment. Contents of the file should look similar to the following.
apiVersion: apps/v1 kind: Deployment metadata: name:
my-app
namespace:my-namespace
labels: app:my-application-label
spec: replicas: 1 selector: matchLabels: app:my-application-label
template: metadata: labels: app:my-application-label
spec: containers: - name:my-app
image:my-repo
/my-image
imagePullPolicy: IfNotPresent -
Add the Amazon AppConfig Agent container definition details to your deployment manifest.
- name: appconfig-agent image: public.ecr.aws/aws-appconfig/aws-appconfig-agent:2.x ports: - name: http containerPort: 2772 protocol: TCP env: - name: SERVICE_REGION value:
Amazon Web Services Region
imagePullPolicy: IfNotPresentNote
Note the following information.
-
Amazon AppConfig Agent runs on port 2772, by default. You can specify a different port.
-
You can adjust the default behavior of Amazon AppConfig Agent by entering environment variables. For more information, see (Optional) Using environment variables to configure Amazon AppConfig Agent for Amazon ECS and Amazon EKS.
-
For
Amazon Web Services Region
, specify the Amazon Web Services Region code (for example,us-west-1
) where Amazon AppConfig Agent retrieves configuration data.
-
-
Run the following
kubectl
command to apply the changes to your cluster. Replacemy-deployment
with the name of your deployment manifest.kubectl apply -f
my-deployment
.yml -
After the deployment finishes, verify that Amazon AppConfig Agent is running. Use the following command to view the application pod log file.
kubectl logs -n
my-namespace
-c appconfig-agentmy-pod
Locate a statement like the following for the Amazon AppConfig Agent container:
[appconfig agent] 1970/01/01 00:00:00 INFO serving on localhost:2772
Note
You can adjust the default behavior of Amazon AppConfig Agent by entering or changing environment variables. For information about the available environment variables, see (Optional) Using environment variables to configure Amazon AppConfig Agent for Amazon ECS and Amazon EKS.