-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewrelic-infrastructure-k8s-latest.yaml
106 lines (106 loc) · 3.36 KB
/
newrelic-infrastructure-k8s-latest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: newrelic
namespace: default
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: newrelic
rules:
- apiGroups: [""]
resources:
- "nodes"
- "nodes/metrics"
- "nodes/stats"
- "nodes/proxy"
- "pods"
- "services"
verbs: ["get", "list"]
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: newrelic-infra
namespace: default
labels:
app: newrelic-infra
spec:
selector:
matchLabels:
name: newrelic-infra
updateStrategy:
type: RollingUpdate # Only supported in Kubernetes version 1.6 or later.
template:
metadata:
labels:
name: newrelic-infra
annotations:
# Needed for Kubernetes versions prior to 1.6.0, where tolerations were set via annotations.
scheduler.alpha.kubernetes.io/tolerations: |
[{"operator": "Exists", "effect": "NoSchedule"},{"operator": "Exists", "effect": "NoExecute"}]
spec:
serviceAccountName: newrelic
hostNetwork: true # This option is a requirement for the Infrastructure Agent to report the proper hostname in New Relic.
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: newrelic-infra
image: singhharkamal/nriflex:3.0
securityContext:
privileged: true
resources:
limits:
memory: 150M
requests:
cpu: 100m
memory: 30M
volumeMounts:
- mountPath: /host
name: host-volume
readOnly: true
- mountPath: /var/run/docker.sock
name: host-docker-socket
env:
- name: "CLUSTER_NAME"
value: "hsingh-k8"
- name: "NRIA_LICENSE_KEY"
value: ""
- name: "NRIA_VERBOSE"
value: "0"
- name: CONTAINER_DISCOVERY
value: "true"
#- name: "CADVISOR_PORT" # Enable direct connection to cAdvisor by specifying the port. Needed for Kubernetes versions prior to 1.7.6.
# value: "4194"
# - name: "KUBE_STATE_METRICS_URL" # If this value is specified then discovery process for kube-state-metrics endpoint won't be triggered.
# value: "http://172.17.0.3:8080" # This is example value. Only HTTP request is accepted.
- name: "NRIA_DISPLAY_NAME"
valueFrom:
fieldRef:
apiVersion: "v1"
fieldPath: "spec.nodeName"
- name: "NRK8S_NODE_NAME"
valueFrom:
fieldRef:
apiVersion: "v1"
fieldPath: "spec.nodeName"
- name: "NRIA_CUSTOM_ATTRIBUTES"
value: '{"clusterName":"$(CLUSTER_NAME)"}'
- name: "TIMEOUT"
value: "5000"
- name: "NRIA_PASSTHROUGH_ENVIRONMENT"
value: "KUBERNETES_SERVICE_HOST,KUBERNETES_SERVICE_PORT,CLUSTER_NAME,CADVISOR_PORT,NRK8S_NODE_NAME,KUBE_STATE_METRICS_URL,TIMEOUT"
volumes:
- name: host-volume
hostPath:
path: /
- name: host-docker-socket
hostPath:
path: /var/run/docker.sock
tolerations:
- operator: "Exists"
effect: "NoSchedule"
- operator: "Exists"
effect: "NoExecute"