Skip to content
Snippets Groups Projects
Commit 8c71e8c8 authored by Kemal Akkoyun's avatar Kemal Akkoyun
Browse files

Remove ksonnet from kube-prometheus-thanos-sidecar.libsonnet

parent 6d641706
No related branches found
No related tags found
No related merge requests found
local k = import 'github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k.libsonnet';
local service = k.core.v1.service;
local servicePort = k.core.v1.service.mixin.spec.portsType;
{ {
_config+:: { _config+:: {
versions+:: { versions+:: { thanos: 'v0.14.0' },
thanos: 'v0.14.0', imageRepos+:: { thanos: 'quay.io/thanos/thanos' },
},
imageRepos+:: {
thanos: 'quay.io/thanos/thanos',
},
thanos+:: { thanos+:: {
objectStorageConfig: { objectStorageConfig: {
key: 'thanos.yaml', // How the file inside the secret is called key: 'thanos.yaml', // How the file inside the secret is called
...@@ -22,19 +14,28 @@ local servicePort = k.core.v1.service.mixin.spec.portsType; ...@@ -22,19 +14,28 @@ local servicePort = k.core.v1.service.mixin.spec.portsType;
service+: { service+: {
spec+: { spec+: {
ports+: [ ports+: [
servicePort.newNamed('grpc', 10901, 10901), { name: 'grpc', port: 10901, targetPort: 10901 },
], ],
}, },
}, },
// Create a new service that exposes both sidecar's HTTP metrics port and gRPC StoreAPI // Create a new service that exposes both sidecar's HTTP metrics port and gRPC StoreAPI
serviceThanosSidecar: serviceThanosSidecar: {
local thanosGrpcSidecarPort = servicePort.newNamed('grpc', 10901, 10901); apiVersion: 'v1',
local thanosHttpSidecarPort = servicePort.newNamed('http', 10902, 10902); kind: 'Service',
service.new('prometheus-' + $._config.prometheus.name + '-thanos-sidecar', { app: 'prometheus', prometheus: $._config.prometheus.name }) + metadata: {
service.mixin.spec.withPorts([thanosGrpcSidecarPort, thanosHttpSidecarPort]) + name: 'prometheus-' + $._config.prometheus.name + '-thanos-sidecar',
service.mixin.spec.withClusterIp('None') + namespace: $._config.namespace,
service.mixin.metadata.withLabels({'prometheus': $._config.prometheus.name, 'app': 'thanos-sidecar'}) + labels: { prometheus: $._config.prometheus.name, app: 'thanos-sidecar' },
service.mixin.metadata.withNamespace($._config.namespace), },
spec: {
ports: [
{ name: 'grpc', port: 10901, targetPort: 10901 },
{ name: 'http', port: 10902, targetPort: 10902 },
],
selector: { app: 'prometheus', prometheus: $._config.prometheus.name },
clusterIP: 'None',
},
},
prometheus+: { prometheus+: {
spec+: { spec+: {
thanos+: { thanos+: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment