mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2025-05-12 16:32:00 +00:00
Compare commits
174 Commits
Author | SHA1 | Date | |
---|---|---|---|
7b592c6832 | |||
203aaeafb9 | |||
5926f1aea1 | |||
be1e1c635d | |||
094a9f9b9d | |||
47d34b328c | |||
4b5b96084b | |||
18f4c82f07 | |||
10dc42b9e9 | |||
20db592a62 | |||
d0a3ea1934 | |||
837e7b9c5d | |||
9d8359b580 | |||
71a8e99d1f | |||
4d4c70c553 | |||
2ccd6903d9 | |||
f58db31f98 | |||
0bf8f5dd0f | |||
e600557636 | |||
0f06db7cdf | |||
1c9038b2cc | |||
fd4ead837e | |||
f46f801811 | |||
4acdf72ef7 | |||
e04cd10bfc | |||
8fe330941a | |||
0730c6ef1e | |||
c5411c74b7 | |||
4ba6b66441 | |||
0dbe769e1b | |||
582a78d4ec | |||
481df883e5 | |||
318d47e05e | |||
190f0db092 | |||
c618494177 | |||
a08860d06c | |||
6b0afe5180 | |||
9722e38f62 | |||
35aa03c771 | |||
34c833e04a | |||
c93c1dd7bb | |||
59d39bc51c | |||
4066e450e5 | |||
8415373f3d | |||
d1969a3020 | |||
582c94255f | |||
c626f414db | |||
1d4beab7a4 | |||
eefd5ef512 | |||
599b3bf805 | |||
ecf21df9c0 | |||
ecd296e644 | |||
446b7f01ea | |||
0ad7296d56 | |||
9da155554b | |||
d7f9664d52 | |||
85f6dda229 | |||
64a6b85c73 | |||
f41af0d82b | |||
194bede7a3 | |||
c4f5efb6a7 | |||
51e9378ee6 | |||
ce27ef1798 | |||
a73ef467cd | |||
e6a04531fb | |||
7289e6f8e2 | |||
60b1dc097a | |||
6b46cc2599 | |||
6f9aba8db8 | |||
a382dbfe7b | |||
7a68304389 | |||
7044e79b08 | |||
e16bacb24e | |||
726c1e691d | |||
debc90ca72 | |||
6343c8ea15 | |||
eb0575f11e | |||
52bfbbb1b0 | |||
cf5872ef08 | |||
b5432fb1f3 | |||
5466badd90 | |||
aef1837e47 | |||
4e86d6ae34 | |||
2874c1a6a7 | |||
b5006746f0 | |||
9496ab7fd3 | |||
aa7f86291e | |||
486a6c4262 | |||
aaf66f31a0 | |||
e5bee93bf6 | |||
aae3772472 | |||
76d3726e5b | |||
ea4a651afe | |||
721c6553d8 | |||
5aa2272e37 | |||
b9300d1e46 | |||
5747b6c9de | |||
6d15a1635a | |||
4090ab8b32 | |||
1f56abf931 | |||
f216070630 | |||
8725f02db7 | |||
240452ca27 | |||
45d7863e73 | |||
87f249d36b | |||
9967a55df8 | |||
adf0792079 | |||
99fa5c42ed | |||
188cc91574 | |||
a8ff0ed6f0 | |||
cc9279b283 | |||
9bb7d976a0 | |||
816661f7fd | |||
7ae70d798d | |||
0ef5ad1cfe | |||
c86235636b | |||
2d119e68e4 | |||
df3efe0e39 | |||
a5b5cb91c3 | |||
ebcf99ad27 | |||
3d450ad2c2 | |||
78a9b5c253 | |||
4e2b9d9788 | |||
38aeb4deed | |||
b7aa886546 | |||
942e753f87 | |||
86ed6ec102 | |||
b313c963b6 | |||
ca20ef3a3b | |||
f2179846c5 | |||
85089c4773 | |||
2ac9dd29d8 | |||
2bfc85ff3d | |||
d55a551bd8 | |||
3174100f5a | |||
16808f012d | |||
2531ddcbe3 | |||
8ff2e3985b | |||
dab5a66556 | |||
995ec54aa5 | |||
6f71e9c6b0 | |||
ed16830a77 | |||
7f84bc75f4 | |||
b5fbb1beae | |||
4506701b7c | |||
df0ed1fca4 | |||
bb107b678c | |||
8d7dc13bbd | |||
20f0042017 | |||
c732851b6b | |||
2e09132f95 | |||
95f22dc398 | |||
eed5c78fb3 | |||
e61071a36d | |||
c108fab55a | |||
be7567efea | |||
b677e814be | |||
deec4727ee | |||
cf369639d8 | |||
262a35c2ec | |||
607386834b | |||
4bdce4da4d | |||
801e5d7a47 | |||
4df21ae2b4 | |||
7f639baeee | |||
88ddb6f10e | |||
d9cf2e0858 | |||
c3b18e784b | |||
c3a03fd758 | |||
05704c0a6b | |||
f3a608fcf7 | |||
223ec9fd89 | |||
81255aa956 | |||
dac44965e3 |
35
.github/CODEOWNERS
vendored
35
.github/CODEOWNERS
vendored
@ -1,35 +0,0 @@
|
|||||||
# These owners will be the default owners for everything in
|
|
||||||
# the repo.
|
|
||||||
* @arjunrn
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Samples for assigning codeowners below:
|
|
||||||
# Order is important; the last matching pattern takes the most
|
|
||||||
# precedence. When someone opens a pull request that only
|
|
||||||
# modifies JS files, only @js-owner and not the global
|
|
||||||
# owner(s) will be requested for a review.
|
|
||||||
# *.js @js-owner
|
|
||||||
|
|
||||||
# You can also use email addresses if you prefer. They'll be
|
|
||||||
# used to look up users just like we do for commit author
|
|
||||||
# emails.
|
|
||||||
# *.go docs@example.com
|
|
||||||
|
|
||||||
# In this example, @doctocat owns any files in the build/logs
|
|
||||||
# directory at the root of the repository and any of its
|
|
||||||
# subdirectories.
|
|
||||||
# /build/logs/ @doctocat
|
|
||||||
|
|
||||||
# The `docs/*` pattern will match files like
|
|
||||||
# `docs/getting-started.md` but not further nested files like
|
|
||||||
# `docs/build-app/troubleshooting.md`.
|
|
||||||
# docs/* docs@example.com
|
|
||||||
|
|
||||||
# In this example, @octocat owns any file in an apps directory
|
|
||||||
# anywhere in your repository.
|
|
||||||
# apps/ @octocat
|
|
||||||
|
|
||||||
# In this example, @doctocat owns any file in the `/docs`
|
|
||||||
# directory in the root of your repository.
|
|
||||||
# /docs/ @doctocat
|
|
14
.github/dependabot.yml
vendored
Normal file
14
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: gomod
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
time: "07:00"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
time: "07:00"
|
||||||
|
open-pull-requests-limit: 10
|
21
.github/workflows/ci.yaml
vendored
Normal file
21
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: ci
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '^1.18'
|
||||||
|
- run: go version
|
||||||
|
- run: go install github.com/mattn/goveralls@latest
|
||||||
|
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
|
||||||
|
env:
|
||||||
|
GOLANGCI_RELEASE: v1.46.2
|
||||||
|
- run: make build.docker
|
||||||
|
- run: make test
|
||||||
|
- run: make check
|
||||||
|
- run: goveralls -coverprofile=profile.cov -service=github
|
||||||
|
env:
|
||||||
|
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
72
.github/workflows/codeql-analysis.yml
vendored
Normal file
72
.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ "master" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '29 17 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'go' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
|
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
|
||||||
|
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||||
|
# queries: security-extended,security-and-quality
|
||||||
|
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
|
|
||||||
|
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||||
|
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||||
|
|
||||||
|
# - run: |
|
||||||
|
# echo "Run, Build Application using script"
|
||||||
|
# ./location_of_script_within_repo/buildscript.sh
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
build/
|
build/
|
||||||
apiserver.local.config/
|
apiserver.local.config/
|
||||||
.idea/
|
.idea/
|
||||||
|
profile.cov
|
||||||
vendor/
|
vendor/
|
||||||
|
20
.travis.yml
20
.travis.yml
@ -1,20 +0,0 @@
|
|||||||
language: go
|
|
||||||
dist: xenial
|
|
||||||
|
|
||||||
go:
|
|
||||||
- "1.14.x"
|
|
||||||
|
|
||||||
env:
|
|
||||||
- GO111MODULE=on GOLANGCI_RELEASE="v1.21.0"
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- GO111MODULE=off go get github.com/mattn/goveralls
|
|
||||||
- GO111MODULE=off go get github.com/lawrencewoodman/roveralls
|
|
||||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make test
|
|
||||||
- make build.docker
|
|
||||||
- make check
|
|
||||||
- roveralls
|
|
||||||
- goveralls -v -coverprofile=roveralls.coverprofile -service=travis-ci
|
|
@ -1,5 +1,7 @@
|
|||||||
FROM registry.opensource.zalan.do/stups/alpine:latest
|
FROM registry.opensource.zalan.do/library/alpine-3.13:latest
|
||||||
MAINTAINER Team Teapot @ Zalando SE <team-teapot@zalando.de>
|
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
||||||
|
|
||||||
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
# add binary
|
# add binary
|
||||||
ADD build/linux/kube-metrics-adapter /
|
ADD build/linux/kube-metrics-adapter /
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
Mikkel Larsen <mikkel.larsen@zalando.de>
|
Mikkel Larsen <mikkel.larsen@zalando.de>
|
||||||
Arjun Naik <arjun.naik@zalando.de>
|
|
||||||
Team Teapot <team-teapot@zalando.de>
|
Team Teapot <team-teapot@zalando.de>
|
||||||
|
40
Makefile
40
Makefile
@ -8,31 +8,57 @@ SOURCES = $(shell find . -name '*.go')
|
|||||||
DOCKERFILE ?= Dockerfile
|
DOCKERFILE ?= Dockerfile
|
||||||
GOPKGS = $(shell go list ./...)
|
GOPKGS = $(shell go list ./...)
|
||||||
BUILD_FLAGS ?= -v
|
BUILD_FLAGS ?= -v
|
||||||
|
OPENAPI ?= pkg/api/generated/openapi/zz_generated.openapi.go
|
||||||
LDFLAGS ?= -X main.version=$(VERSION) -w -s
|
LDFLAGS ?= -X main.version=$(VERSION) -w -s
|
||||||
|
CRD_SOURCES = $(shell find pkg/apis/zalando.org -name '*.go')
|
||||||
|
CRD_TYPE_SOURCE = pkg/apis/zalando.org/v1/types.go
|
||||||
|
GENERATED_CRDS = docs/scaling_schedules_crd.yaml
|
||||||
|
GENERATED = pkg/apis/zalando.org/v1/zz_generated.deepcopy.go
|
||||||
|
|
||||||
|
|
||||||
default: build.local
|
default: build.local
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
rm -rf $(OPENAPI)
|
||||||
|
|
||||||
test:
|
test: $(GENERATED)
|
||||||
go test -v $(GOPKGS)
|
go test -v -coverprofile=profile.cov $(GOPKGS)
|
||||||
|
|
||||||
check:
|
check: $(GENERATED)
|
||||||
go mod download
|
go mod download
|
||||||
golangci-lint run --timeout=2m ./...
|
golangci-lint run --timeout=2m ./...
|
||||||
|
|
||||||
build.local: build/$(BINARY)
|
|
||||||
|
$(GENERATED): go.mod $(CRD_TYPE_SOURCE) $(OPENAPI)
|
||||||
|
./hack/update-codegen.sh
|
||||||
|
|
||||||
|
$(GENERATED_CRDS): $(GENERATED) $(CRD_SOURCES)
|
||||||
|
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 paths=./pkg/apis/... output:crd:dir=docs || /bin/true || true
|
||||||
|
mv docs/zalando.org_clusterscalingschedules.yaml docs/cluster_scaling_schedules_crd.yaml
|
||||||
|
mv docs/zalando.org_scalingschedules.yaml docs/scaling_schedules_crd.yaml
|
||||||
|
|
||||||
|
$(OPENAPI): go.mod
|
||||||
|
go run k8s.io/kube-openapi/cmd/openapi-gen \
|
||||||
|
--go-header-file hack/boilerplate.go.txt \
|
||||||
|
--logtostderr \
|
||||||
|
-i k8s.io/metrics/pkg/apis/custom_metrics,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,k8s.io/metrics/pkg/apis/custom_metrics/v1beta2,k8s.io/metrics/pkg/apis/external_metrics,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,k8s.io/metrics/pkg/apis/metrics,k8s.io/metrics/pkg/apis/metrics/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version,k8s.io/api/core/v1 \
|
||||||
|
-p pkg/api/generated/openapi \
|
||||||
|
-o . \
|
||||||
|
-O zz_generated.openapi \
|
||||||
|
-r /dev/null
|
||||||
|
|
||||||
|
build.local: build/$(BINARY) $(GENERATED_CRDS)
|
||||||
build.linux: build/linux/$(BINARY)
|
build.linux: build/linux/$(BINARY)
|
||||||
build.osx: build/osx/$(BINARY)
|
build.osx: build/osx/$(BINARY)
|
||||||
|
|
||||||
build/$(BINARY): go.mod $(SOURCES)
|
build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||||
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
|
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
|
||||||
|
|
||||||
build/linux/$(BINARY): go.mod $(SOURCES)
|
build/linux/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||||
|
|
||||||
build/osx/$(BINARY): go.mod $(SOURCES)
|
build/osx/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
|
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||||
|
|
||||||
build.docker: build.linux
|
build.docker: build.linux
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
version: "2017-09-20"
|
version: "2017-09-20"
|
||||||
pipeline:
|
pipeline:
|
||||||
- id: build
|
- id: build
|
||||||
overlay: ci/golang
|
vm_config:
|
||||||
|
type: linux
|
||||||
|
image: "cdp-runtime/go"
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- /go/pkg/mod # pkg cache for Go modules
|
- /go/pkg/mod # pkg cache for Go modules
|
||||||
|
124
docs/cluster_scaling_schedules_crd.yaml
Normal file
124
docs/cluster_scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.8.0
|
||||||
|
creationTimestamp: null
|
||||||
|
name: clusterscalingschedules.zalando.org
|
||||||
|
spec:
|
||||||
|
group: zalando.org
|
||||||
|
names:
|
||||||
|
kind: ClusterScalingSchedule
|
||||||
|
listKind: ClusterScalingScheduleList
|
||||||
|
plural: clusterscalingschedules
|
||||||
|
singular: clusterscalingschedule
|
||||||
|
scope: Cluster
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: ClusterScalingSchedule describes a cluster scoped time based
|
||||||
|
metric to be used in autoscaling operations.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
of an object. Servers should convert recognized schemas to the latest
|
||||||
|
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: 'Kind is a string value representing the REST resource this
|
||||||
|
object represents. Servers may infer this from the endpoint the client
|
||||||
|
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
scalingWindowDurationMinutes:
|
||||||
|
description: Fade the scheduled values in and out over this many minutes.
|
||||||
|
If unset, the default per-cluster value will be used.
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
schedules:
|
||||||
|
description: Schedules is the list of schedules for this ScalingSchedule
|
||||||
|
resource. All the schedules defined here will result on the value
|
||||||
|
to the same metric. New metrics require a new ScalingSchedule resource.
|
||||||
|
items:
|
||||||
|
description: Schedule is the schedule details to be used inside
|
||||||
|
a ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
description: Defines the starting date of a OneTime schedule.
|
||||||
|
It has to be a RFC3339 formated date.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
durationMinutes:
|
||||||
|
description: The duration in minutes that the configured value
|
||||||
|
will be returned for the defined schedule.
|
||||||
|
type: integer
|
||||||
|
period:
|
||||||
|
description: Defines the details of a Repeating schedule.
|
||||||
|
properties:
|
||||||
|
days:
|
||||||
|
description: The days that this schedule will be active.
|
||||||
|
items:
|
||||||
|
description: ScheduleDay represents the valid inputs for
|
||||||
|
days in a SchedulePeriod.
|
||||||
|
enum:
|
||||||
|
- Sun
|
||||||
|
- Mon
|
||||||
|
- Tue
|
||||||
|
- Wed
|
||||||
|
- Thu
|
||||||
|
- Fri
|
||||||
|
- Sat
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
startTime:
|
||||||
|
description: The startTime has the format HH:MM
|
||||||
|
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
description: The location name corresponding to a file in
|
||||||
|
the IANA Time Zone database, like Europe/Berlin.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- days
|
||||||
|
- startTime
|
||||||
|
- timezone
|
||||||
|
type: object
|
||||||
|
type:
|
||||||
|
description: Defines if the schedule is a OneTime schedule or
|
||||||
|
Repeating one. If OneTime, date has to be defined. If Repeating,
|
||||||
|
Period has to be defined.
|
||||||
|
enum:
|
||||||
|
- OneTime
|
||||||
|
- Repeating
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
description: The metric value that will be returned for the
|
||||||
|
defined schedule.
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- durationMinutes
|
||||||
|
- type
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- schedules
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- spec
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
@ -1,4 +1,4 @@
|
|||||||
apiVersion: apiregistration.k8s.io/v1beta1
|
apiVersion: apiregistration.k8s.io/v1
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.custom.metrics.k8s.io
|
name: v1beta1.custom.metrics.k8s.io
|
||||||
|
@ -28,6 +28,7 @@ spec:
|
|||||||
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local
|
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local
|
||||||
- --skipper-ingress-metrics
|
- --skipper-ingress-metrics
|
||||||
- --aws-external-metrics
|
- --aws-external-metrics
|
||||||
|
- --scaling-schedule
|
||||||
env:
|
env:
|
||||||
- name: AWS_REGION
|
- name: AWS_REGION
|
||||||
value: eu-central-1
|
value: eu-central-1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
apiVersion: apiregistration.k8s.io/v1beta1
|
apiVersion: apiregistration.k8s.io/v1
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.external.metrics.k8s.io
|
name: v1beta1.external.metrics.k8s.io
|
||||||
|
9
docs/helm/Chart.yaml
Normal file
9
docs/helm/Chart.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
version: 0.1.18
|
||||||
|
description: kube-metrics-adapter helm chart
|
||||||
|
home: https://github.com/zalando-incubator/kube-metrics-adapter
|
||||||
|
maintainers:
|
||||||
|
- name: The Zalando Incubator
|
||||||
|
email: opensource@zalando.de
|
||||||
|
url: https://github.com/zalando-incubator
|
119
docs/helm/templates/cluster_scaling_schedules_crd.yaml
Normal file
119
docs/helm/templates/cluster_scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
{{- if .Values.scalingSchedule.enabled }}
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.5.0
|
||||||
|
creationTimestamp: null
|
||||||
|
name: clusterscalingschedules.zalando.org
|
||||||
|
spec:
|
||||||
|
group: zalando.org
|
||||||
|
names:
|
||||||
|
kind: ClusterScalingSchedule
|
||||||
|
listKind: ClusterScalingScheduleList
|
||||||
|
plural: clusterscalingschedules
|
||||||
|
singular: clusterscalingschedule
|
||||||
|
scope: Cluster
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: ClusterScalingSchedule describes a cluster scoped time based
|
||||||
|
metric to be used in autoscaling operations.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
of an object. Servers should convert recognized schemas to the latest
|
||||||
|
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: 'Kind is a string value representing the REST resource this
|
||||||
|
object represents. Servers may infer this from the endpoint the client
|
||||||
|
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
schedules:
|
||||||
|
description: Schedules is the list of schedules for this ScalingSchedule
|
||||||
|
resource. All the schedules defined here will result on the value
|
||||||
|
to the same metric. New metrics require a new ScalingSchedule resource.
|
||||||
|
items:
|
||||||
|
description: Schedule is the schedule details to be used inside
|
||||||
|
a ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
description: Defines the starting date of a OneTime schedule.
|
||||||
|
It has to be a RFC3339 formated date.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
durationMinutes:
|
||||||
|
description: The duration in minutes that the configured value
|
||||||
|
will be returned for the defined schedule.
|
||||||
|
type: integer
|
||||||
|
period:
|
||||||
|
description: Defines the details of a Repeating schedule.
|
||||||
|
properties:
|
||||||
|
days:
|
||||||
|
description: The days that this schedule will be active.
|
||||||
|
items:
|
||||||
|
description: ScheduleDay represents the valid inputs for
|
||||||
|
days in a SchedulePeriod.
|
||||||
|
enum:
|
||||||
|
- Sun
|
||||||
|
- Mon
|
||||||
|
- Tue
|
||||||
|
- Wed
|
||||||
|
- Thu
|
||||||
|
- Fri
|
||||||
|
- Sat
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
startTime:
|
||||||
|
description: The startTime has the format HH:MM
|
||||||
|
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
description: The location name corresponding to a file in
|
||||||
|
the IANA Time Zone database, like Europe/Berlin.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- days
|
||||||
|
- startTime
|
||||||
|
- timezone
|
||||||
|
type: object
|
||||||
|
type:
|
||||||
|
description: Defines if the schedule is a OneTime schedule or
|
||||||
|
Repeating one. If OneTime, date has to be defined. If Repeating,
|
||||||
|
Period has to be defined.
|
||||||
|
enum:
|
||||||
|
- OneTime
|
||||||
|
- Repeating
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
description: The metric value that will be returned for the
|
||||||
|
defined schedule.
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- durationMinutes
|
||||||
|
- type
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- schedules
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- spec
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
||||||
|
{{- end}}
|
15
docs/helm/templates/custom-metrics-apiservice.yaml
Normal file
15
docs/helm/templates/custom-metrics-apiservice.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{{- if .Values.enableCustomMetricsApi }}
|
||||||
|
apiVersion: apiregistration.k8s.io/v1
|
||||||
|
kind: APIService
|
||||||
|
metadata:
|
||||||
|
name: v1beta1.custom.metrics.k8s.io
|
||||||
|
spec:
|
||||||
|
service:
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
group: custom.metrics.k8s.io
|
||||||
|
version: v1beta1
|
||||||
|
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
||||||
|
groupPriorityMinimum: 100
|
||||||
|
versionPriority: 100
|
||||||
|
{{- end}}
|
209
docs/helm/templates/deployment.yaml
Normal file
209
docs/helm/templates/deployment.yaml
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
labels:
|
||||||
|
application: kube-metrics-adapter
|
||||||
|
version: {{ .Values.registry.imageTag }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicas }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
application: kube-metrics-adapter
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
application: kube-metrics-adapter
|
||||||
|
version: {{ .Values.registry.imageTag }}
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: kube-metrics-adapter
|
||||||
|
{{- if .Values.nodeSelector }}
|
||||||
|
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tolerations }}
|
||||||
|
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.affinity }}
|
||||||
|
affinity: {{ toYaml .Values.affinity | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: kube-metrics-adapter
|
||||||
|
image: {{ .Values.registry.image}}:{{ .Values.registry.imageTag }}
|
||||||
|
args:
|
||||||
|
{{- if .Values.addDirectoryHeader }}
|
||||||
|
- --add_dir_header={{ .Values.addDirectoryHeader }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.alsoToStderr }}
|
||||||
|
- --alsologtostderr={{ .Values.log.alsoToStderr }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authentication.kubeConfig }}
|
||||||
|
- --authentication-kubeconfig={{ .Values.authentication.kubeConfig }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authentication.skipLookup }}
|
||||||
|
- --authentication-skip-lookup={{ .Values.authentication.skipLookup }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authentication.tokenWebhookCacheTtl }}
|
||||||
|
- --authentication-token-webhook-cache-ttl={{ .Values.authentication.tokenWebhookCacheTtl }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authentication.tolerateLookupFailure }}
|
||||||
|
- --authentication-tolerate-lookup-failure={{ .Values.authentication.tolerateLookupFailure }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authorization.alwaysAllowPaths }}
|
||||||
|
- --authorization-always-allow-paths={{ .Values.authorization.alwaysAllowPaths }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authorization.kubeConfig }}
|
||||||
|
- --authorization-kubeconfig={{ .Values.authorization.kubeConfig }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authorization.webhookCache.authorizedTtl }}
|
||||||
|
- --authorization-webhook-cache-authorized-ttl={{ .Values.authorization.webhookCache.authorizedTtl }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.authorization.webhookCache.unauthorizedTtl }}
|
||||||
|
- --authorization-webhook-cache-unauthorized-ttl={{ .Values.authorization.webhookCache.unauthorizedTtl }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.aws.externalMetrics }}
|
||||||
|
- --aws-external-metrics={{ .Values.aws.externalMetrics }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.aws.region }}
|
||||||
|
- --aws-region={{ .Values.aws.region }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.certificateDirectory }}
|
||||||
|
- --cert-dir={{ .Values.tls.certificateDirectory }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.clientCaFile }}
|
||||||
|
- --client-ca-file={{ .Values.tls.clientCaFile }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.contentionProfiling }}
|
||||||
|
- --contention-profiling={{ .Values.contentionProfiling }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.credentialsDirectory }}
|
||||||
|
- --credentials-dir={{ .Values.credentialsDirectory }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.disregardIncompatibleHPAs }}
|
||||||
|
- --disregard-incompatible-hpas={{ .Values.disregardIncompatibleHPAs }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.enableCustomMetricsApi }}
|
||||||
|
- --enable-custom-metrics-api={{ .Values.enableCustomMetricsApi }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.enableExternalMetricsApi }}
|
||||||
|
- --enable-external-metrics-api={{ .Values.enableExternalMetricsApi }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.http2MaxStreamsPerConnection }}
|
||||||
|
- --http2-max-streams-per-connection={{ .Values.http2MaxStreamsPerConnection }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.influxDB.address }}
|
||||||
|
- --influxdb-address={{ .Values.influxDB.address }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.influxDB.organization }}
|
||||||
|
- --influxdb-org={{ .Values.influxDB.organization }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.influxDB.token }}
|
||||||
|
- --influxdb-token={{ .Values.influxDB.token }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.listerKubeConfig }}
|
||||||
|
- --lister-kubeconfig={{ .Values.listerKubeConfig }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.flushFrequency }}
|
||||||
|
- --log-flush-frequency={{ .Values.log.flushFrequency }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.backtraceAtTraceLocation }}
|
||||||
|
- --log_backtrace_at={{ .Values.log.backtraceAtTraceLocation }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.directory }}
|
||||||
|
- --log_dir={{ .Values.log.directory }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.file }}
|
||||||
|
- --log_file={{ .Values.log.file }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.fileMaxSize }}
|
||||||
|
- --log_file_max_size={{ .Values.log.fileMaxSize }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.toStderr }}
|
||||||
|
- --logtostderr={{ .Values.log.toStderr }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.prometheus.metricsAddress }}
|
||||||
|
- --metrics-address={{ .Values.prometheus.metricsAddress }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.profiling }}
|
||||||
|
- --profiling={{ .Values.profiling }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.prometheus.server }}
|
||||||
|
- --prometheus-server={{ .Values.prometheus.server }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.requestHeader.allowedNames }}
|
||||||
|
- --requestheader-allowed-names={{ .Values.requestHeader.allowedNames }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.requestHeader.clientCaFile }}
|
||||||
|
- --requestheader-client-ca-file={{ .Values.requestHeader.clientCaFile }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.requestHeader.extraHeadersPrefix }}
|
||||||
|
- --requestheader-extra-headers-prefix={{ .Values.requestHeader.extraHeadersPrefix }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.requestHeader.groupHeaders }}
|
||||||
|
- --requestheader-group-headers={{ .Values.requestHeader.groupHeaders }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.requestHeader.usernameHeaders }}
|
||||||
|
- --requestheader-username-headers={{ .Values.requestHeader.usernameHeaders }}
|
||||||
|
{{- end}}
|
||||||
|
- --secure-port={{ .Values.service.internalPort }}
|
||||||
|
{{- if .Values.log.skipHeaders }}
|
||||||
|
- --skip_headers={{ .Values.log.skipHeaders }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.skipLogHeaders }}
|
||||||
|
- --skip_log_headers={{ .Values.log.skipLogHeaders }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.skipperBackendsAnnotation }}
|
||||||
|
- --skipper-backends-annotation={{ .Values.skipperBackendsAnnotation }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.skipperIngressMetrics }}
|
||||||
|
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.stderrThreshold }}
|
||||||
|
- --stderrthreshold={{ .Values.log.stderrThreshold }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.certFile }}
|
||||||
|
- --tls-cert-file={{ .Values.tls.certFile }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.cipherSuites }}
|
||||||
|
- --tls-cipher-suites={{ .Values.tls.cipherSuites }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.minVersion }}
|
||||||
|
- --tls-min-version={{ .Values.tls.minVersion }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.privateKeyFile }}
|
||||||
|
- --tls-private-key-file={{ .Values.tls.privateKeyFile }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.tls.sniCertKey }}
|
||||||
|
- --tls-sni-cert-key={{ .Values.tls.sniCertKey }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.token }}
|
||||||
|
- --token={{ .Values.token }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.log.level }}
|
||||||
|
- --v={{ .Values.log.level }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.vmodule }}
|
||||||
|
- --vmodule={{ .Values.vmodule }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.zmon.kariosdbEndpoint }}
|
||||||
|
- --zmon-kariosdb-endpoint={{ .Values.zmon.kariosdbEndpoint }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.zmon.tokenName }}
|
||||||
|
- --zmon-token-name={{ .Values.zmon.tokenName }}
|
||||||
|
{{- end}}
|
||||||
|
{{- if .Values.scalingSchedule.enabled }}
|
||||||
|
- --scaling-schedule
|
||||||
|
{{- end}}
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.resources.limits.memory }}
|
||||||
|
requests:
|
||||||
|
cpu: {{ .Values.resources.requests.cpu }}
|
||||||
|
memory: {{ .Values.resources.requests.memory }}
|
15
docs/helm/templates/external-metrics-apiservice.yaml
Normal file
15
docs/helm/templates/external-metrics-apiservice.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{{- if .Values.enableExternalMetricsApi }}
|
||||||
|
apiVersion: apiregistration.k8s.io/v1
|
||||||
|
kind: APIService
|
||||||
|
metadata:
|
||||||
|
name: v1beta1.external.metrics.k8s.io
|
||||||
|
spec:
|
||||||
|
service:
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
group: external.metrics.k8s.io
|
||||||
|
version: v1beta1
|
||||||
|
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
||||||
|
groupPriorityMinimum: 100
|
||||||
|
versionPriority: 100
|
||||||
|
{{- end}}
|
165
docs/helm/templates/rbac.yaml
Normal file
165
docs/helm/templates/rbac.yaml
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-server-resources
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- custom.metrics.k8s.io
|
||||||
|
resources: ["*"]
|
||||||
|
verbs: ["*"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: external-metrics-server-resources
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- external.metrics.k8s.io
|
||||||
|
resources: ["*"]
|
||||||
|
verbs: ["*"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-resource-reader
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
- pods
|
||||||
|
- services
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-resource-collector
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- patch
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
verbs:
|
||||||
|
- list
|
||||||
|
- apiGroups:
|
||||||
|
- apps
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
- statefulsets
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- apiGroups:
|
||||||
|
- networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- ingresses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- apiGroups:
|
||||||
|
- autoscaling
|
||||||
|
resources:
|
||||||
|
- horizontalpodautoscalers
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
{{- if .Values.scalingSchedule.enabled }}
|
||||||
|
- apiGroups:
|
||||||
|
- zalando.org
|
||||||
|
resources:
|
||||||
|
- clusterscalingschedules
|
||||||
|
- scalingschedules
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
{{- end}}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: hpa-controller-custom-metrics
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kube-metrics-adapter-server-resources
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: horizontal-pod-autoscaler
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: hpa-controller-external-metrics
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: external-metrics-server-resources
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: horizontal-pod-autoscaler
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-auth-reader
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: extension-apiserver-authentication-reader
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: custom-metrics:system:auth-delegator
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: system:auth-delegator
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-resource-collector
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kube-metrics-adapter-resource-collector
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter-resource-reader
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kube-metrics-adapter-resource-reader
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
119
docs/helm/templates/scaling_schedules_crd.yaml
Normal file
119
docs/helm/templates/scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
{{- if .Values.scalingSchedule.enabled }}
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.5.0
|
||||||
|
creationTimestamp: null
|
||||||
|
name: scalingschedules.zalando.org
|
||||||
|
spec:
|
||||||
|
group: zalando.org
|
||||||
|
names:
|
||||||
|
kind: ScalingSchedule
|
||||||
|
listKind: ScalingScheduleList
|
||||||
|
plural: scalingschedules
|
||||||
|
singular: scalingschedule
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: ScalingSchedule describes a namespaced time based metric to be
|
||||||
|
used in autoscaling operations.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
of an object. Servers should convert recognized schemas to the latest
|
||||||
|
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: 'Kind is a string value representing the REST resource this
|
||||||
|
object represents. Servers may infer this from the endpoint the client
|
||||||
|
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
schedules:
|
||||||
|
description: Schedules is the list of schedules for this ScalingSchedule
|
||||||
|
resource. All the schedules defined here will result on the value
|
||||||
|
to the same metric. New metrics require a new ScalingSchedule resource.
|
||||||
|
items:
|
||||||
|
description: Schedule is the schedule details to be used inside
|
||||||
|
a ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
description: Defines the starting date of a OneTime schedule.
|
||||||
|
It has to be a RFC3339 formated date.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
durationMinutes:
|
||||||
|
description: The duration in minutes that the configured value
|
||||||
|
will be returned for the defined schedule.
|
||||||
|
type: integer
|
||||||
|
period:
|
||||||
|
description: Defines the details of a Repeating schedule.
|
||||||
|
properties:
|
||||||
|
days:
|
||||||
|
description: The days that this schedule will be active.
|
||||||
|
items:
|
||||||
|
description: ScheduleDay represents the valid inputs for
|
||||||
|
days in a SchedulePeriod.
|
||||||
|
enum:
|
||||||
|
- Sun
|
||||||
|
- Mon
|
||||||
|
- Tue
|
||||||
|
- Wed
|
||||||
|
- Thu
|
||||||
|
- Fri
|
||||||
|
- Sat
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
startTime:
|
||||||
|
description: The startTime has the format HH:MM
|
||||||
|
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
description: The location name corresponding to a file in
|
||||||
|
the IANA Time Zone database, like Europe/Berlin.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- days
|
||||||
|
- startTime
|
||||||
|
- timezone
|
||||||
|
type: object
|
||||||
|
type:
|
||||||
|
description: Defines if the schedule is a OneTime schedule or
|
||||||
|
Repeating one. If OneTime, date has to be defined. If Repeating,
|
||||||
|
Period has to be defined.
|
||||||
|
enum:
|
||||||
|
- OneTime
|
||||||
|
- Repeating
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
description: The metric value that will be returned for the
|
||||||
|
defined schedule.
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- durationMinutes
|
||||||
|
- type
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- schedules
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- spec
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
||||||
|
{{- end}}
|
5
docs/helm/templates/service-account.yaml
Normal file
5
docs/helm/templates/service-account.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
11
docs/helm/templates/service.yaml
Normal file
11
docs/helm/templates/service.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: kube-metrics-adapter
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.service.port }}
|
||||||
|
targetPort: {{ .Values.service.internalPort }}
|
||||||
|
selector:
|
||||||
|
application: kube-metrics-adapter
|
108
docs/helm/values.yaml
Normal file
108
docs/helm/values.yaml
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
namespace: kube-system
|
||||||
|
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
registry:
|
||||||
|
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
|
||||||
|
imageTag: v0.1.10
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
service:
|
||||||
|
port: 443
|
||||||
|
internalPort: 443
|
||||||
|
|
||||||
|
addDirectoryHeader:
|
||||||
|
contentionProfiling:
|
||||||
|
profiling:
|
||||||
|
enableCustomMetricsApi:
|
||||||
|
enableExternalMetricsApi:
|
||||||
|
credentialsDirectory:
|
||||||
|
disregardIncompatibleHPAs:
|
||||||
|
http2MaxStreamsPerConnection:
|
||||||
|
listerKubeConfig:
|
||||||
|
skipperBackendsAnnotation:
|
||||||
|
skipperIngressMetrics:
|
||||||
|
token:
|
||||||
|
vmodule:
|
||||||
|
|
||||||
|
authentication:
|
||||||
|
kubeConfig:
|
||||||
|
skipLookup:
|
||||||
|
tokenWebhookCacheTtl:
|
||||||
|
tolerateLookupFailure:
|
||||||
|
|
||||||
|
authorization:
|
||||||
|
kubeConfig:
|
||||||
|
alwaysAllowPaths:
|
||||||
|
webhookCache:
|
||||||
|
authorizedTtl:
|
||||||
|
unauthorizedTtl:
|
||||||
|
|
||||||
|
aws:
|
||||||
|
externalMetrics:
|
||||||
|
region:
|
||||||
|
|
||||||
|
influxDB:
|
||||||
|
address:
|
||||||
|
organization:
|
||||||
|
token:
|
||||||
|
|
||||||
|
log:
|
||||||
|
alsoToStderr:
|
||||||
|
toStderr:
|
||||||
|
flushFrequency:
|
||||||
|
backtraceAtTraceLocation:
|
||||||
|
directory:
|
||||||
|
file:
|
||||||
|
fileMaxSize:
|
||||||
|
level:
|
||||||
|
stderrThreshold:
|
||||||
|
skipHeaders:
|
||||||
|
skipLogHeaders:
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
server: http://prometheus.kube-system.svc.cluster.local
|
||||||
|
metricsAddress:
|
||||||
|
|
||||||
|
requestHeader:
|
||||||
|
allowedNames:
|
||||||
|
clientCaFile:
|
||||||
|
extraHeadersPrefix:
|
||||||
|
groupHeaders:
|
||||||
|
usernameHeaders:
|
||||||
|
|
||||||
|
tls:
|
||||||
|
skipTLSVerify: true
|
||||||
|
certificateDirectory:
|
||||||
|
clientCaFile:
|
||||||
|
certFile:
|
||||||
|
cipherSuites:
|
||||||
|
minVersion:
|
||||||
|
privateKeyFile:
|
||||||
|
sniCertKey:
|
||||||
|
|
||||||
|
zmon:
|
||||||
|
kariosdbEndpoint:
|
||||||
|
tokenName:
|
||||||
|
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 100Mi
|
||||||
|
|
||||||
|
scalingSchedule:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
priorityClassName: ""
|
||||||
|
|
||||||
|
podAnnotations: {}
|
@ -64,12 +64,22 @@ rules:
|
|||||||
- statefulsets
|
- statefulsets
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
|
# only relevant if running with the flag:
|
||||||
|
# --skipper-ingress-metrics
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- extensions
|
- networking.k8s.io
|
||||||
resources:
|
resources:
|
||||||
- ingresses
|
- ingresses
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
|
# only relevant if running with the flag:
|
||||||
|
# --skipper-routegroup-metrics
|
||||||
|
- apiGroups:
|
||||||
|
- zalando.org
|
||||||
|
resources:
|
||||||
|
- routegroups
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- autoscaling
|
- autoscaling
|
||||||
resources:
|
resources:
|
||||||
@ -78,6 +88,15 @@ rules:
|
|||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- zalando.org
|
||||||
|
resources:
|
||||||
|
- clusterscalingschedules
|
||||||
|
- scalingschedules
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
124
docs/scaling_schedules_crd.yaml
Normal file
124
docs/scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.8.0
|
||||||
|
creationTimestamp: null
|
||||||
|
name: scalingschedules.zalando.org
|
||||||
|
spec:
|
||||||
|
group: zalando.org
|
||||||
|
names:
|
||||||
|
kind: ScalingSchedule
|
||||||
|
listKind: ScalingScheduleList
|
||||||
|
plural: scalingschedules
|
||||||
|
singular: scalingschedule
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: ScalingSchedule describes a namespaced time based metric to be
|
||||||
|
used in autoscaling operations.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
of an object. Servers should convert recognized schemas to the latest
|
||||||
|
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: 'Kind is a string value representing the REST resource this
|
||||||
|
object represents. Servers may infer this from the endpoint the client
|
||||||
|
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
scalingWindowDurationMinutes:
|
||||||
|
description: Fade the scheduled values in and out over this many minutes.
|
||||||
|
If unset, the default per-cluster value will be used.
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
schedules:
|
||||||
|
description: Schedules is the list of schedules for this ScalingSchedule
|
||||||
|
resource. All the schedules defined here will result on the value
|
||||||
|
to the same metric. New metrics require a new ScalingSchedule resource.
|
||||||
|
items:
|
||||||
|
description: Schedule is the schedule details to be used inside
|
||||||
|
a ScalingSchedule.
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
description: Defines the starting date of a OneTime schedule.
|
||||||
|
It has to be a RFC3339 formated date.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
durationMinutes:
|
||||||
|
description: The duration in minutes that the configured value
|
||||||
|
will be returned for the defined schedule.
|
||||||
|
type: integer
|
||||||
|
period:
|
||||||
|
description: Defines the details of a Repeating schedule.
|
||||||
|
properties:
|
||||||
|
days:
|
||||||
|
description: The days that this schedule will be active.
|
||||||
|
items:
|
||||||
|
description: ScheduleDay represents the valid inputs for
|
||||||
|
days in a SchedulePeriod.
|
||||||
|
enum:
|
||||||
|
- Sun
|
||||||
|
- Mon
|
||||||
|
- Tue
|
||||||
|
- Wed
|
||||||
|
- Thu
|
||||||
|
- Fri
|
||||||
|
- Sat
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
startTime:
|
||||||
|
description: The startTime has the format HH:MM
|
||||||
|
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
description: The location name corresponding to a file in
|
||||||
|
the IANA Time Zone database, like Europe/Berlin.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- days
|
||||||
|
- startTime
|
||||||
|
- timezone
|
||||||
|
type: object
|
||||||
|
type:
|
||||||
|
description: Defines if the schedule is a OneTime schedule or
|
||||||
|
Repeating one. If OneTime, date has to be defined. If Repeating,
|
||||||
|
Period has to be defined.
|
||||||
|
enum:
|
||||||
|
- OneTime
|
||||||
|
- Repeating
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
description: The metric value that will be returned for the
|
||||||
|
defined schedule.
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- durationMinutes
|
||||||
|
- type
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- schedules
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- spec
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
@ -1,5 +1,5 @@
|
|||||||
FROM registry.opensource.zalan.do/stups/alpine:latest
|
FROM registry.opensource.zalan.do/library/alpine-3.13:latest
|
||||||
MAINTAINER Team Teapot @ Zalando SE <team-teapot@zalando.de>
|
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
||||||
|
|
||||||
# add binary
|
# add binary
|
||||||
ADD build/linux/custom-metrics-consumer /
|
ADD build/linux/custom-metrics-consumer /
|
||||||
|
@ -6,7 +6,7 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
application: custom-metrics-consumer
|
application: custom-metrics-consumer
|
||||||
annotations:
|
annotations:
|
||||||
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey>
|
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
|
||||||
metric-config.pods.queue-length.json-path/json-key: "$.queue.length"
|
metric-config.pods.queue-length.json-path/json-key: "$.queue.length"
|
||||||
metric-config.pods.queue-length.json-path/path: /metrics
|
metric-config.pods.queue-length.json-path/path: /metrics
|
||||||
metric-config.pods.queue-length.json-path/port: "9090"
|
metric-config.pods.queue-length.json-path/port: "9090"
|
||||||
@ -39,7 +39,7 @@ spec:
|
|||||||
- type: Object
|
- type: Object
|
||||||
object:
|
object:
|
||||||
describedObject:
|
describedObject:
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
name: custom-metrics-consumer
|
name: custom-metrics-consumer
|
||||||
metric:
|
metric:
|
||||||
@ -50,9 +50,10 @@ spec:
|
|||||||
- type: External
|
- type: External
|
||||||
external:
|
external:
|
||||||
metric:
|
metric:
|
||||||
name: sqs-queue-length
|
name: app-queue-length
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
type: sqs-queue-length
|
||||||
queue-name: foobar
|
queue-name: foobar
|
||||||
region: eu-central-1
|
region: eu-central-1
|
||||||
target:
|
target:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
apiVersion: extensions/v1beta1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: custom-metrics-consumer
|
name: custom-metrics-consumer
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user