# # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to use, copy, modify, # merge, publish, distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # --- apiVersion: apps/v1 kind: DaemonSet metadata: name: xray-daemon namespace: microservices-aws spec: selector: matchLabels: app: xray-daemon updateStrategy: type: RollingUpdate 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: limits: memory: 64Mi cpu: 500m requests: memory: 36Mi cpu: 200m ports: - name: xray-ingest containerPort: 2000 hostPort: 2000 protocol: UDP - name: xray 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: microservices-aws data: config.yaml: |- # Maximum buffer size in MB (minimum 3). Choose 0 to use 1% of host memory. 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: microservices-aws spec: selector: app: xray-daemon clusterIP: None ports: - name: incoming port: 2000 protocol: UDP - name: incoming-tcp port: 2000 protocol: TCP