Fix ports for ksm and kubelet

This commit is contained in:
Carlos de Paula 2019-08-20 16:35:09 -03:00
parent c0fb818677
commit b6cdf80843
4 changed files with 19 additions and 9 deletions

View File

@ -100,12 +100,12 @@ local vars = import 'vars.jsonnet';
ports: [{ ports: [{
name: 'http-main', name: 'http-main',
port: 8080, port: 8080,
targetPort: 'http' targetPort: '8080'
}, },
{ {
name: 'http-self', name: 'http-self',
port: 8081, port: 8081,
targetPort: 'http' targetPort: '8081'
}] }]
} }
}, },

View File

@ -14,7 +14,7 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet')
+ (import 'kube-prometheus/kube-prometheus-kops-coredns.libsonnet') + (import 'kube-prometheus/kube-prometheus-kops-coredns.libsonnet')
+ (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') + (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet')
// Use http Kubelet targets. Comment to revert to https // Use http Kubelet targets. Comment to revert to https
+ (import 'kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet') + join_objects([m for m in [import 'kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet'] if vars.k3s == false])
+ (import 'smtp_server.jsonnet') + (import 'smtp_server.jsonnet')
// Additional modules are loaded dynamically from vars.jsonnet // Additional modules are loaded dynamically from vars.jsonnet
+ join_objects([module.file for module in vars.modules if module.enabled]) + join_objects([module.file for module in vars.modules if module.enabled])

View File

@ -10,9 +10,9 @@ spec:
ports: ports:
- name: http-main - name: http-main
port: 8080 port: 8080
targetPort: http targetPort: "8080"
- name: http-self - name: http-self
port: 8081 port: 8081
targetPort: http targetPort: "8081"
selector: selector:
app: kube-state-metrics app: kube-state-metrics

View File

@ -8,15 +8,25 @@ metadata:
spec: spec:
endpoints: endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
interval: 30s interval: 30s
port: http-metrics port: https-metrics
scheme: http scheme: https
tlsConfig:
insecureSkipVerify: true
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true honorLabels: true
interval: 30s interval: 30s
metricRelabelings:
- action: drop
regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s)
sourceLabels:
- __name__
path: /metrics/cadvisor path: /metrics/cadvisor
port: http-metrics port: https-metrics
scheme: http scheme: https
tlsConfig:
insecureSkipVerify: true
jobLabel: k8s-app jobLabel: k8s-app
namespaceSelector: namespaceSelector:
matchNames: matchNames: