Added PodMonitor for kube-proxy
This commit is contained in:
@@ -22,6 +22,7 @@ local defaults = {
|
||||
hostNetworkInterfaceSelector: 'device!~"veth.+"',
|
||||
},
|
||||
},
|
||||
kubeProxy: false,
|
||||
};
|
||||
|
||||
function(params) {
|
||||
@@ -234,6 +235,45 @@ function(params) {
|
||||
},
|
||||
},
|
||||
|
||||
[if (defaults + params).kubeProxy then 'podMonitorKubeProxy']: {
|
||||
apiVersion: 'monitoring.coreos.com/v1',
|
||||
kind: 'PodMonitor',
|
||||
metadata: {
|
||||
labels: {
|
||||
'k8s-app': 'kube-proxy',
|
||||
},
|
||||
name: 'kube-proxy',
|
||||
namespace: k8s._config.namespace,
|
||||
},
|
||||
spec: {
|
||||
jobLabel: 'k8s-app',
|
||||
namespaceSelector: {
|
||||
matchNames: [
|
||||
'kube-system',
|
||||
],
|
||||
},
|
||||
selector: {
|
||||
matchLabels: {
|
||||
'k8s-app': 'kube-proxy',
|
||||
},
|
||||
},
|
||||
podMetricsEndpoints: [{
|
||||
honorLabels: true,
|
||||
targetPort: 10249,
|
||||
relabelings: [
|
||||
{
|
||||
action: 'replace',
|
||||
regex: '(.*)',
|
||||
replacement: '$1',
|
||||
sourceLabels: ['__meta_kubernetes_pod_node_name'],
|
||||
targetLabel: 'instance',
|
||||
},
|
||||
],
|
||||
}],
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
serviceMonitorCoreDNS: {
|
||||
apiVersion: 'monitoring.coreos.com/v1',
|
||||
kind: 'ServiceMonitor',
|
||||
|
||||
Reference in New Issue
Block a user