From 5c19ad2ab2158b8a7e91d5767a720442c700bed8 Mon Sep 17 00:00:00 2001 From: Carlos de Paula Date: Tue, 20 Aug 2019 17:45:42 -0300 Subject: [PATCH] Expose ports on KSM for K3s --- k3s-overrides.jsonnet | 13 +++++++++++-- manifests/kube-state-metrics-deployment.yaml | 5 +++++ manifests/kube-state-metrics-service.yaml | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/k3s-overrides.jsonnet b/k3s-overrides.jsonnet index b95f660..dd6be1d 100644 --- a/k3s-overrides.jsonnet +++ b/k3s-overrides.jsonnet @@ -84,6 +84,15 @@ local vars = import 'vars.jsonnet'; '--port=8080', '--telemetry-port=8081', ], + ports: [ + { + containerPort: 8080, + name: 'http-main' + }, + { + containerPort: 8081, + name: 'http-self' + }], } else c, @@ -100,12 +109,12 @@ local vars = import 'vars.jsonnet'; ports: [{ name: 'http-main', port: 8080, - targetPort: '8080' + targetPort: 'http-main' }, { name: 'http-self', port: 8081, - targetPort: '8081' + targetPort: 'http-self' }] } }, diff --git a/manifests/kube-state-metrics-deployment.yaml b/manifests/kube-state-metrics-deployment.yaml index 3d3dbdb..251f18a 100644 --- a/manifests/kube-state-metrics-deployment.yaml +++ b/manifests/kube-state-metrics-deployment.yaml @@ -21,6 +21,11 @@ spec: - --telemetry-port=8081 image: carlosedp/kube-state-metrics:v1.7.2 name: kube-state-metrics + ports: + - containerPort: 8080 + name: http-main + - containerPort: 8081 + name: http-self resources: limits: cpu: 100m diff --git a/manifests/kube-state-metrics-service.yaml b/manifests/kube-state-metrics-service.yaml index 7b0ca4a..2179e7e 100644 --- a/manifests/kube-state-metrics-service.yaml +++ b/manifests/kube-state-metrics-service.yaml @@ -10,9 +10,9 @@ spec: ports: - name: http-main port: 8080 - targetPort: "8080" + targetPort: http-main - name: http-self port: 8081 - targetPort: "8081" + targetPort: http-self selector: app: kube-state-metrics