Skip to content

Instantly share code, notes, and snippets.

@mumoshu
Created May 29, 2020 00:44
Show Gist options
  • Save mumoshu/128b2870937a1dc09a85a7fc14730957 to your computer and use it in GitHub Desktop.
Save mumoshu/128b2870937a1dc09a85a7fc14730957 to your computer and use it in GitHub Desktop.
---
# Source: datadog/charts/kube-state-metrics/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: kube-state-metrics-2.8.4
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: datadog
name: datadog-kube-state-metrics
namespace: datadog-system
imagePullSecrets:
[]
---
# Source: datadog/templates/rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: "7"
name: datadog
---
# Source: datadog/templates/secrets.yaml
# API Key
apiVersion: v1
kind: Secret
metadata:
name: datadog
labels:
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: "7"
type: Opaque
data:
api-key: "PERBVEFET0dfQVBJX0tFWT4="
# APP Key
---
# Source: datadog/templates/cluster-agent-config-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: datadog-cluster-agent-config
labels:
app: "datadog"
chart: "datadog-2.3.5"
release: "datadog"
heritage: "Helm"
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: 7
annotations:
checksum/clusteragent-config: 07091d9e7b63ac86966e39652ca5327568145ae7b61a16b7d5df29f918641ea5
data:
foo: bar
---
# Source: datadog/charts/kube-state-metrics/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: kube-state-metrics-2.8.4
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: datadog
name: datadog-kube-state-metrics
rules:
- apiGroups: ["certificates.k8s.io"]
resources:
- certificatesigningrequests
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["list", "watch"]
- apiGroups: ["batch"]
resources:
- cronjobs
verbs: ["list", "watch"]
- apiGroups: ["extensions", "apps"]
resources:
- daemonsets
verbs: ["list", "watch"]
- apiGroups: ["extensions", "apps"]
resources:
- deployments
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- endpoints
verbs: ["list", "watch"]
- apiGroups: ["autoscaling"]
resources:
- horizontalpodautoscalers
verbs: ["list", "watch"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources:
- ingresses
verbs: ["list", "watch"]
- apiGroups: ["batch"]
resources:
- jobs
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- limitranges
verbs: ["list", "watch"]
- apiGroups: ["admissionregistration.k8s.io"]
resources:
- mutatingwebhookconfigurations
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- namespaces
verbs: ["list", "watch"]
- apiGroups: ["networking.k8s.io"]
resources:
- networkpolicies
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- nodes
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- persistentvolumeclaims
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- persistentvolumes
verbs: ["list", "watch"]
- apiGroups: ["policy"]
resources:
- poddisruptionbudgets
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- pods
verbs: ["list", "watch"]
- apiGroups: ["extensions", "apps"]
resources:
- replicasets
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- replicationcontrollers
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- resourcequotas
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- secrets
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- services
verbs: ["list", "watch"]
- apiGroups: ["apps"]
resources:
- statefulsets
verbs: ["list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources:
- storageclasses
verbs: ["list", "watch"]
- apiGroups: ["admissionregistration.k8s.io"]
resources:
- validatingwebhookconfigurations
verbs: ["list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources:
- volumeattachments
verbs: ["list", "watch"]
- apiGroups: ["autoscaling.k8s.io"]
resources:
- verticalpodautoscalers
verbs: ["list", "watch"]
---
# Source: datadog/templates/rbac.yaml
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRole
metadata:
labels:
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: "7"
name: datadog
rules:
- apiGroups:
- ""
resources:
- services
- events
- endpoints
- pods
- nodes
- componentstatuses
verbs:
- get
- list
- watch
- apiGroups: ["quota.openshift.io"]
resources:
- clusterresourcequotas
verbs:
- get
- list
- nonResourceURLs:
- "/version"
- "/healthz"
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups: # Kubelet connectivity
- ""
resources:
- nodes/metrics
- nodes/spec
- nodes/proxy
- nodes/stats
verbs:
- get
- apiGroups: # leader election check
- ""
resources:
- endpoints
verbs:
- get
---
# Source: datadog/charts/kube-state-metrics/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: kube-state-metrics-2.8.4
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: datadog
name: datadog-kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: datadog-kube-state-metrics
subjects:
- kind: ServiceAccount
name: datadog-kube-state-metrics
namespace: datadog-system
---
# Source: datadog/templates/rbac.yaml
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: "7"
name: datadog
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: datadog
subjects:
- kind: ServiceAccount
name: datadog
namespace: datadog-system
---
# Source: datadog/charts/kube-state-metrics/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: datadog-kube-state-metrics
namespace: datadog-system
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: "kube-state-metrics-2.8.4"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
annotations:
prometheus.io/scrape: 'true'
spec:
type: "ClusterIP"
ports:
- name: "http"
protocol: TCP
port: 8080
targetPort: 8080
selector:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/instance: datadog
---
# Source: datadog/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: datadog
labels:
helm.sh/chart: "datadog-2.3.5"
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/version: "7"
spec:
selector:
matchLabels:
app: datadog
template:
metadata:
labels:
app: datadog
name: datadog
annotations:
checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
checksum/checksd-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
spec:
containers:
- name: agent
image: "datadog/agent:7.19.0"
imagePullPolicy: IfNotPresent
command: ["agent", "start"]
resources:
{}
ports:
- containerPort: 8125
name: dogstatsdport
protocol: UDP
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: "datadog"
key: api-key
- name: DD_KUBERNETES_KUBELET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: KUBERNETES
value: "yes"
- name: DOCKER_HOST
value: unix:///host/var/run/docker.sock
- name: DD_LOG_LEVEL
value: "INFO"
- name: DD_DOGSTATSD_PORT
value: "8125"
- name: DD_APM_ENABLED
value: "false"
- name: DD_LOGS_ENABLED
value: "false"
- name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
value: "false"
- name: DD_LOGS_CONFIG_K8S_CONTAINER_USE_FILE
value: "true"
- name: DD_HEALTH_PORT
value: "5555"
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
- name: runtimesocketdir
mountPath: /host/var/run
readOnly: true
- name: procdir
mountPath: /host/proc
readOnly: true
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
livenessProbe:
failureThreshold: 6
httpGet:
path: /health
port: 5555
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
- name: process-agent
image: "datadog/agent:7.19.0"
imagePullPolicy: IfNotPresent
command: ["process-agent", "-config=/etc/datadog-agent/datadog.yaml"]
resources:
{}
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: "datadog"
key: api-key
- name: DD_KUBERNETES_KUBELET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: KUBERNETES
value: "yes"
- name: DOCKER_HOST
value: unix:///host/var/run/docker.sock
- name: DD_LOG_LEVEL
value: "INFO"
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
- name: runtimesocketdir
mountPath: /host/var/run
readOnly: true
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
- name: passwd
mountPath: /etc/passwd
- name: procdir
mountPath: /host/proc
readOnly: true
initContainers:
- name: init-volume
image: "datadog/agent:7.19.0"
imagePullPolicy: IfNotPresent
command: ["bash", "-c"]
args:
- cp -r /etc/datadog-agent /opt
volumeMounts:
- name: config
mountPath: /opt/datadog-agent
resources:
{}
- name: init-config
image: "datadog/agent:7.19.0"
imagePullPolicy: IfNotPresent
command: ["bash", "-c"]
args:
- for script in $(find /etc/cont-init.d/ -type f -name '*.sh' | sort) ; do bash $script ; done
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
- name: procdir
mountPath: /host/proc
readOnly: true
- name: runtimesocketdir
mountPath: /host/var/run
readOnly: true
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: "datadog"
key: api-key
- name: DD_KUBERNETES_KUBELET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: KUBERNETES
value: "yes"
- name: DOCKER_HOST
value: unix:///host/var/run/docker.sock
resources:
{}
volumes:
- name: config
emptyDir: {}
- hostPath:
path: /var/run
name: runtimesocketdir
- hostPath:
path: /proc
name: procdir
- hostPath:
path: /sys/fs/cgroup
name: cgroups
- name: s6-run
emptyDir: {}
- hostPath:
path: /etc/passwd
name: passwd
tolerations:
affinity:
null
serviceAccountName: datadog
nodeSelector:
updateStrategy:
rollingUpdate:
maxUnavailable: 10%
type: RollingUpdate
---
# Source: datadog/charts/kube-state-metrics/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: datadog-kube-state-metrics
namespace: datadog-system
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: "kube-state-metrics-2.8.4"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: "Helm"
spec:
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/instance: "datadog"
spec:
hostNetwork: false
serviceAccountName: datadog-kube-state-metrics
securityContext:
fsGroup: 65534
runAsUser: 65534
containers:
- name: kube-state-metrics
args:
- --collectors=certificatesigningrequests
- --collectors=configmaps
- --collectors=cronjobs
- --collectors=daemonsets
- --collectors=deployments
- --collectors=endpoints
- --collectors=horizontalpodautoscalers
- --collectors=ingresses
- --collectors=jobs
- --collectors=limitranges
- --collectors=mutatingwebhookconfigurations
- --collectors=namespaces
- --collectors=networkpolicies
- --collectors=nodes
- --collectors=persistentvolumeclaims
- --collectors=persistentvolumes
- --collectors=poddisruptionbudgets
- --collectors=pods
- --collectors=replicasets
- --collectors=replicationcontrollers
- --collectors=resourcequotas
- --collectors=secrets
- --collectors=services
- --collectors=statefulsets
- --collectors=storageclasses
- --collectors=validatingwebhookconfigurations
- --collectors=verticalpodautoscalers
- --collectors=volumeattachments
imagePullPolicy: IfNotPresent
image: "quay.io/coreos/kube-state-metrics:v1.9.5"
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
---
# Source: datadog/templates/containers-common-env.yaml
# The purpose of this template is to define a minimal set of environment
# variables required to operate dedicated containers in the daemonset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment