# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" file accompanying this file. This file is distributed # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. apiVersion: v1 kind: ServiceAccount metadata: labels: app: xray-daemon name: xray-daemon namespace: default # IAM permissions for AWS X-Ray daemon. # Run `eksctl create iamserviceaccount \ # --name service_account_name \ # --namespace service_account_namespace \ # --cluster cluster_name \ # --attach-policy-arn arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess \ # --approve \ # --override-existing-serviceaccounts` # # Then uncomment the next two lines and add your new role-arn. #annotations: #eks.amazonaws.com/role-arn: arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME --- apiVersion: apps/v1 kind: DaemonSet metadata: name: xray-daemon namespace: default spec: updateStrategy: type: RollingUpdate selector: matchLabels: app: xray-daemon template: metadata: labels: app: xray-daemon spec: serviceAccountName: xray-daemon volumes: - name: config-volume configMap: name: "xray-config" containers: - name: xray-daemon image: amazon/aws-xray-daemon command: ["/usr/bin/xray", "-c", "/aws/xray/config.yaml"] resources: requests: cpu: 256m memory: 32Mi limits: cpu: 512m memory: 64Mi ports: - name: xray-ingest containerPort: 2000 hostPort: 2000 protocol: UDP - name: xray-tcp containerPort: 2000 hostPort: 2000 protocol: TCP volumeMounts: - name: config-volume mountPath: /aws/xray readOnly: true --- # Configuration for AWS X-Ray daemon apiVersion: v1 kind: ConfigMap metadata: name: xray-config namespace: default data: config.yaml: |- TotalBufferSizeMB: 24 Socket: UDPAddress: "0.0.0.0:2000" TCPAddress: "0.0.0.0:2000" Version: 2 --- # k8s service definition for AWS X-Ray daemon headless service apiVersion: v1 kind: Service metadata: name: xray-service namespace: default spec: selector: app: xray-daemon clusterIP: None ports: - name: xray-ingest port: 2000 protocol: UDP - name: xray-tcp port: 2000 protocol: TCP