cdks8-xray
Provides a cdk8s Construct to synthesize AWS X-Ray api-resources on Amazon EKS.
Installation and Usage
Install cdk8s-xray
construct from npm
or yarn
:
npm install -s cdk8s-xray
Usage:
// inside your chart:new XRayAppthis, 'prod', config;
Features:
-
Adapted from the EKS Workshop X-Ray. A few
cdk8s
quirks make the generated manifest different though:manifest.k8s.yaml
apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata:name: xray-prod-clusterrolebinding-xray-daemon-b962136eroleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: cluster-adminsubjects:- kind: ServiceAccountname: xray-daemonnamespace: default---apiVersion: v1kind: Servicemetadata:name: xray-servicespec:clusterIP: Noneports:- name: incomingport: 2000protocol: UDPselector:app: xray-daemoncdk8s/chart: xray---apiVersion: v1kind: ServiceAccountmetadata:labels:app: xray-daemoncdk8s/chart: xrayname: xray-daemonnamespace: default---apiVersion: apps/v1kind: DaemonSetmetadata:name: xray-prod-daemonset-xray-daemon-fcac88afspec:selector:matchLabels:app: xray-daemoncdk8s/chart: xraytemplate:metadata:labels:app: xray-daemoncdk8s/chart: xrayspec:containers:- command:- /usr/bin/xray- -c- /aws/xray/config.yamlimage: rnzdocker1/eks-workshop-x-ray-daemon:dbada4c77e6ae10ecf5a7b1c5864aa6522d9fb02imagePullPolicy: Alwaysname: xray-daemonports:- containerPort: 2000hostPort: 2000name: xray-ingestprotocol: UDPresources:limits:memory: 24MivolumeMounts:- mountPath: /aws/xrayname: config-volumereadOnly: truehostNetwork: truevolumes:- configMap:name: xray-configname: config-volumeupdateStrategy:type: RollingUpdate---apiVersion: v1data:config.yaml: >-# Maximum buffer size in MB (minimum 3). Choose 0 to use 1% of host memory.TotalBufferSizeMB: 0# Maximum number of concurrent calls to AWS X-Ray to upload segment documents.Concurrency: 8# Send segments to AWS X-Ray service in a specific regionRegion: ""# Change the X-Ray service endpoint to which the daemon sends segment documents.Endpoint: ""Socket:# Change the address and port on which the daemon listens for UDP packets containing segment documents.# Make sure we listen on all IP's by default for the k8s setupUDPAddress: 0.0.0.0:2000Logging:LogRotation: true# Change the log level, from most verbose to least: dev, debug, info, warn, error, prod (default).LogLevel: prod# Output logs to the specified file path.LogPath: ""# Turn on local mode to skip EC2 instance metadata check.LocalMode: false# Amazon Resource Name (ARN) of the AWS resource running the daemon.ResourceARN: ""# Assume an IAM role to upload segments to a different account.RoleARN: ""# Disable TLS certificate verification.NoVerifySSL: false# Upload segments to AWS X-Ray through a proxy.ProxyAddress: ""# Daemon configuration file format version.Version: 1kind: ConfigMapmetadata:name: xray-config
Release Notes:
Initial Release, Contributions welcome
License:
Apache-2.0