Compare commits
2 Commits
dependabot
...
automate/r
Author | SHA1 | Date | |
---|---|---|---|
37547ce460 | |||
7a0c251972 |
.github
.gitignore.golangci.yml.travis.ymlCONTRIBUTING.mdDockerfileMakefileREADME.mdVERSIONdelivery.yamldocs
cluster_scaling_schedules_crd.yamlcustom-metrics-apiservice.yamldeployment.yamlexternal-metrics-apiservice.yaml
helm
Chart.yaml
rbac.yamlscaling_schedules_crd.yamltemplates
cluster_scaling_schedules_crd.yamlcustom-metrics-apiservice.yamldeployment.yamlexternal-metrics-apiservice.yamlrbac.yamlscaling_schedules_crd.yaml
values.yamlexample
go.modgo.sumhack
pkg
annotations
api/generated/openapi
apis/zalando.org
client
clientset/versioned
informers/externalversions
listers/zalando.org/v1
collector
aws_collector.gocollector.gocollector_test.goexternal_rps_collector.goexternal_rps_collector_test.gofake_collector_test.gohttp_collector.gohttp_collector_test.go
httpmetrics
influxdb_collector.goinfluxdb_collector_test.gonakadi_collector.gopod_collector.gopod_collector_test.goprometheus_collector.goprometheus_collector_test.goscaling_schedule_collector.goscaling_schedule_collector_test.goskipper_collector.goskipper_collector_test.gozmon_collector.gozmon_collector_test.gocontroller/scheduledscaling
nakadi
provider
server
zmon
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@ -3,16 +3,9 @@ updates:
|
||||
- package-ecosystem: gomod
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
interval: monthly
|
||||
time: "07:00"
|
||||
open-pull-requests-limit: 10
|
||||
groups:
|
||||
all-go-mod-patch-and-minor:
|
||||
patterns: ["*"]
|
||||
update-types: ["patch", "minor"]
|
||||
ignore:
|
||||
# Ignore k8s and its transitives modules as they are upgraded manually
|
||||
- dependency-name: "k8s.io/*"
|
||||
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
|
||||
- package-ecosystem: docker
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
25
.github/workflows/ci.yaml
vendored
25
.github/workflows/ci.yaml
vendored
@ -1,25 +0,0 @@
|
||||
name: ci
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'gh-pages'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- 'gh-pages'
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.19'
|
||||
- run: go version
|
||||
- run: go install github.com/mattn/goveralls@latest
|
||||
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
- run: make build.docker
|
||||
- run: make test
|
||||
- run: make check
|
||||
- run: goveralls -coverprofile=profile.cov -service=github
|
||||
env:
|
||||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
77
.github/workflows/codeql-analysis.yml
vendored
77
.github/workflows/codeql-analysis.yml
vendored
@ -1,77 +0,0 @@
|
||||
# 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@v4
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
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@v3
|
||||
|
||||
# ℹ️ 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@v3
|
91
.github/workflows/gh-packages.yaml
vendored
91
.github/workflows/gh-packages.yaml
vendored
@ -1,91 +0,0 @@
|
||||
name: gh-package-deploy
|
||||
permissions: {}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: "${{ github.repository }}"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
# Adding this block will overridw default values to None if not specified in the block
|
||||
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
packages: write # to push packages
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
||||
|
||||
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
|
||||
with:
|
||||
# https://www.npmjs.com/package/semver#caret-ranges-123-025-004
|
||||
go-version: '^1.21'
|
||||
|
||||
- name: Login to Github Container Registry
|
||||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435
|
||||
id: get-latest-tag
|
||||
|
||||
- name: Build binaries
|
||||
run: |
|
||||
make build.linux.amd64 build.linux.arm64
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Docker meta
|
||||
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
|
||||
id: meta
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
|
||||
with:
|
||||
context: .
|
||||
build-args: BASE_IMAGE=alpine:3
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
# Build and push latest tag
|
||||
- name: Build and push latest
|
||||
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
|
||||
with:
|
||||
context: .
|
||||
build-args: BASE_IMAGE=alpine:3
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
27
.github/workflows/release-chart.yml
vendored
27
.github/workflows/release-chart.yml
vendored
@ -1,27 +0,0 @@
|
||||
name: Release Charts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Run chart-releaser
|
||||
uses: helm/chart-releaser-action@v1.4.0
|
||||
with:
|
||||
charts_dir: docs
|
||||
env:
|
||||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
build/
|
||||
apiserver.local.config/
|
||||
.idea/
|
||||
profile.cov
|
||||
vendor/
|
||||
|
@ -1,13 +1,19 @@
|
||||
run:
|
||||
concurrency: 4
|
||||
linters-settings:
|
||||
golint:
|
||||
min-confidence: 0.9
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- errcheck
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- staticcheck
|
||||
- ineffassign
|
||||
- golint
|
||||
- goimports
|
||||
- errcheck
|
||||
issues:
|
||||
exclude-rules:
|
||||
# Exclude some staticcheck messages
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: "SA9003:"
|
||||
|
20
.travis.yml
Normal file
20
.travis.yml
Normal file
@ -0,0 +1,20 @@
|
||||
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
|
@ -50,7 +50,7 @@ contribution is in line with our goals.
|
||||
- Make sure you sign-off on your commits `git commit -s -m "adding X to change Y"`
|
||||
- Write good commit messages (see below).
|
||||
- Push your changes to a topic branch in your fork of the repository.
|
||||
- As you push your changes, update the pull request with new information and tasks as you complete them
|
||||
- As you push your changes, update the pull request with new infomation and tasks as you complete them
|
||||
- Project maintainers might comment on your work as you progress
|
||||
- When you are done, remove the `work in progess` label and ping the maintainers for a review
|
||||
- Your pull request must receive a :thumbsup: from two [maintainers](MAINTAINERS)
|
||||
|
@ -1,9 +1,7 @@
|
||||
ARG BASE_IMAGE=registry.opensource.zalan.do/library/static:latest
|
||||
FROM ${BASE_IMAGE}
|
||||
FROM registry.opensource.zalan.do/library/alpine-3.12:latest
|
||||
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
ADD build/linux/${TARGETARCH}/kube-metrics-adapter /
|
||||
# add binary
|
||||
ADD build/linux/kube-metrics-adapter /
|
||||
|
||||
ENTRYPOINT ["/kube-metrics-adapter"]
|
||||
|
57
Makefile
57
Makefile
@ -10,10 +10,6 @@ GOPKGS = $(shell go list ./...)
|
||||
BUILD_FLAGS ?= -v
|
||||
OPENAPI ?= pkg/api/generated/openapi/zz_generated.openapi.go
|
||||
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
|
||||
@ -22,62 +18,39 @@ clean:
|
||||
rm -rf build
|
||||
rm -rf $(OPENAPI)
|
||||
|
||||
test: $(GENERATED)
|
||||
go test -v -coverprofile=profile.cov $(GOPKGS)
|
||||
test:
|
||||
go test -v $(GOPKGS)
|
||||
|
||||
check: $(GENERATED)
|
||||
check:
|
||||
go mod download
|
||||
golangci-lint run --timeout=2m ./...
|
||||
|
||||
|
||||
$(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
|
||||
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 \
|
||||
--output-dir pkg/api/generated/openapi \
|
||||
--output-pkg github.com/zalando-incubator/kube-metrics-adapter/pkg/api/generated/openapi \
|
||||
--output-file zz_generated.openapi.go \
|
||||
-r /dev/null \
|
||||
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
|
||||
-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.local: build/$(BINARY)
|
||||
build.linux: build/linux/$(BINARY)
|
||||
build.linux.amd64: build/linux/amd64/$(BINARY)
|
||||
build.linux.arm64: build/linux/arm64/$(BINARY)
|
||||
build.osx: build/osx/$(BINARY)
|
||||
|
||||
|
||||
build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||
build/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build/linux/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||
build/linux/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build/linux/amd64/$(BINARY): go.mod $(SOURCES)
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/amd64/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build/linux/arm64/$(BINARY): go.mod $(SOURCES)
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/arm64/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
build/osx/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build.docker: build.linux
|
||||
docker build --rm -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) --build-arg TARGETARCH= .
|
||||
docker build --rm -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) .
|
||||
|
||||
build.push: build.docker
|
||||
docker push "$(IMAGE):$(TAG)"
|
||||
|
1
VERSION
Normal file
1
VERSION
Normal file
@ -0,0 +1 @@
|
||||
v0.1
|
@ -1,9 +1,7 @@
|
||||
version: "2017-09-20"
|
||||
pipeline:
|
||||
- id: build
|
||||
vm_config:
|
||||
type: linux
|
||||
image: "cdp-runtime/go"
|
||||
overlay: ci/golang
|
||||
cache:
|
||||
paths:
|
||||
- /go/pkg/mod # pkg cache for Go modules
|
||||
@ -22,7 +20,15 @@ pipeline:
|
||||
cmd: |
|
||||
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
||||
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter
|
||||
VERSION=$(git describe --tags --always)
|
||||
LATEST_VERSION=$(git describe --tags --always | awk -F \- '{print $1}')
|
||||
CUR_PART=$(echo $LATEST_VERSION | awk -F . '{print $1"."$2}')
|
||||
VERSION_PART=$(cat VERSION)
|
||||
OLD_PATCH=$(echo $LATEST_VERSION | awk -F . '{print $3}')
|
||||
NEW_PATCH=$((OLD_PATCH + 1))
|
||||
if [ "$CUR_PART" != "$VERSION_PART" ]; then NEW_PATCH=0; fi
|
||||
VERSION=${VERSION_PART}.${NEW_PATCH}
|
||||
echo "Creating release for tag: ${VERSION}"
|
||||
|
||||
else
|
||||
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test
|
||||
VERSION=$CDP_BUILD_VERSION
|
||||
@ -30,17 +36,18 @@ pipeline:
|
||||
IMAGE=$IMAGE VERSION=$VERSION make build.docker
|
||||
git diff --stat --exit-code
|
||||
IMAGE=$IMAGE VERSION=$VERSION make build.push
|
||||
- desc: Build and push image to Zalando's registry
|
||||
cmd: |
|
||||
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
||||
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter
|
||||
VERSION=$(git describe --tags --always)
|
||||
else
|
||||
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter-test
|
||||
VERSION=$CDP_BUILD_VERSION
|
||||
echo "create release page"
|
||||
tf=$(mktemp)
|
||||
echo -e "### Changes\n" >$tf
|
||||
git log -1 --pretty=%B | grep -v 'Signed-off-by:' | grep -v -E '^\s*$' | grep -vE '^\*' >>$tf
|
||||
echo -e "\n### Docker image\n" >>$tf
|
||||
echo -e "Docker image is available in Zalando's Open Source registry:\n" >>$tf
|
||||
echo -e '```' >>$tf
|
||||
echo -e "docker run -it registry.opensource.zalan.do/teapot/kube-metrics-adapter:${VERSION} --help" >>$tf
|
||||
echo -e '```' >>$tf
|
||||
echo "################################"
|
||||
cat $tf
|
||||
echo "################################"
|
||||
git gh-release --message-from-file "${tf}" $VERSION
|
||||
fi
|
||||
make build.linux.amd64 build.linux.arm64
|
||||
|
||||
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
|
||||
docker buildx build --rm --build-arg BASE_IMAGE=container-registry.zalando.net/library/static:latest -t "${IMAGE}:${VERSION}" --platform linux/amd64,linux/arm64 --push .
|
||||
cdp-promote-image "${IMAGE}:${VERSION}"
|
||||
|
@ -1,155 +0,0 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.5
|
||||
name: clusterscalingschedules.zalando.org
|
||||
spec:
|
||||
group: zalando.org
|
||||
names:
|
||||
kind: ClusterScalingSchedule
|
||||
listKind: ClusterScalingScheduleList
|
||||
plural: clusterscalingschedules
|
||||
singular: clusterscalingschedule
|
||||
scope: Cluster
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- description: Whether one or more schedules are currently active.
|
||||
jsonPath: .status.active
|
||||
name: Active
|
||||
type: boolean
|
||||
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 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
durationMinutes:
|
||||
description: |-
|
||||
The duration in minutes (default 0) that the configured value will be
|
||||
returned for the defined schedule.
|
||||
type: integer
|
||||
endDate:
|
||||
description: |-
|
||||
Defines the ending date of a OneTime schedule. It must be
|
||||
a RFC3339 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
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
|
||||
endTime:
|
||||
description: The endTime has the format HH:MM
|
||||
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||
type: string
|
||||
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:
|
||||
- type
|
||||
- value
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- schedules
|
||||
type: object
|
||||
status:
|
||||
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
|
||||
properties:
|
||||
active:
|
||||
default: false
|
||||
description: |-
|
||||
Active is true if at least one of the schedules defined in the
|
||||
scaling schedule is currently active.
|
||||
type: boolean
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
@ -1,4 +1,4 @@
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.custom.metrics.k8s.io
|
||||
|
@ -22,13 +22,12 @@ spec:
|
||||
serviceAccountName: custom-metrics-apiserver
|
||||
containers:
|
||||
- name: kube-metrics-adapter
|
||||
image: ghcr.io/zalando-incubator/kube-metrics-adapter:latest
|
||||
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter:latest
|
||||
args:
|
||||
# - --v=9
|
||||
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local
|
||||
- --skipper-ingress-metrics
|
||||
- --aws-external-metrics
|
||||
- --scaling-schedule
|
||||
env:
|
||||
- name: AWS_REGION
|
||||
value: eu-central-1
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.external.metrics.k8s.io
|
||||
|
@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: kube-metrics-adapter
|
||||
version: 0.2.3
|
||||
version: 0.1.9
|
||||
description: kube-metrics-adapter helm chart
|
||||
home: https://github.com/zalando-incubator/kube-metrics-adapter
|
||||
maintainers:
|
||||
|
@ -1,156 +0,0 @@
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: clusterscalingschedules.zalando.org
|
||||
spec:
|
||||
group: zalando.org
|
||||
names:
|
||||
kind: ClusterScalingSchedule
|
||||
listKind: ClusterScalingScheduleList
|
||||
plural: clusterscalingschedules
|
||||
singular: clusterscalingschedule
|
||||
scope: Cluster
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- description: Whether one or more schedules are currently active.
|
||||
jsonPath: .status.active
|
||||
name: Active
|
||||
type: boolean
|
||||
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 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
durationMinutes:
|
||||
description: |-
|
||||
The duration in minutes (default 0) that the configured value will be
|
||||
returned for the defined schedule.
|
||||
type: integer
|
||||
endDate:
|
||||
description: |-
|
||||
Defines the ending date of a OneTime schedule. It must be
|
||||
a RFC3339 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
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
|
||||
endTime:
|
||||
description: The endTime has the format HH:MM
|
||||
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||
type: string
|
||||
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:
|
||||
- type
|
||||
- value
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- schedules
|
||||
type: object
|
||||
status:
|
||||
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
|
||||
properties:
|
||||
active:
|
||||
default: false
|
||||
description: |-
|
||||
Active is true if at least one of the schedules defined in the
|
||||
scaling schedule is currently active.
|
||||
type: boolean
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
{{- end}}
|
@ -1,5 +1,5 @@
|
||||
{{- if .Values.enableCustomMetricsApi }}
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.custom.metrics.k8s.io
|
||||
@ -12,4 +12,4 @@ spec:
|
||||
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
||||
groupPriorityMinimum: 100
|
||||
versionPriority: 100
|
||||
{{- end}}
|
||||
{{- end}}
|
@ -16,23 +16,8 @@ spec:
|
||||
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 }}
|
||||
@ -164,9 +149,6 @@ spec:
|
||||
{{- if .Values.skipperIngressMetrics }}
|
||||
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
|
||||
{{- end}}
|
||||
{{- if .Values.skipperRouteGroupMetrics }}
|
||||
- --skipper-routegroup-metrics={{ .Values.skipperRouteGroupMetrics }}
|
||||
{{- end}}
|
||||
{{- if .Values.log.stderrThreshold }}
|
||||
- --stderrthreshold={{ .Values.log.stderrThreshold }}
|
||||
{{- end}}
|
||||
@ -200,9 +182,6 @@ spec:
|
||||
{{- 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 }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{- if .Values.enableExternalMetricsApi }}
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.external.metrics.k8s.io
|
||||
|
@ -59,22 +59,12 @@ rules:
|
||||
- statefulsets
|
||||
verbs:
|
||||
- get
|
||||
{{- if .Values.skipperRouteGroupMetrics }}
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
- extensions
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
{{- end }}
|
||||
{{- if .Values.skipperRouteGroupMetrics }}
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- routegroups
|
||||
verbs:
|
||||
- get
|
||||
{{- end }}
|
||||
- apiGroups:
|
||||
- autoscaling
|
||||
resources:
|
||||
@ -83,24 +73,6 @@ rules:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules
|
||||
- scalingschedules
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules/status
|
||||
- scalingschedules/status
|
||||
verbs:
|
||||
- update
|
||||
{{- end}}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
|
@ -1,158 +0,0 @@
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: scalingschedules.zalando.org
|
||||
spec:
|
||||
group: zalando.org
|
||||
names:
|
||||
categories:
|
||||
- all
|
||||
kind: ScalingSchedule
|
||||
listKind: ScalingScheduleList
|
||||
plural: scalingschedules
|
||||
singular: scalingschedule
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- description: Whether one or more schedules are currently active.
|
||||
jsonPath: .status.active
|
||||
name: Active
|
||||
type: boolean
|
||||
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 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
durationMinutes:
|
||||
description: |-
|
||||
The duration in minutes (default 0) that the configured value will be
|
||||
returned for the defined schedule.
|
||||
type: integer
|
||||
endDate:
|
||||
description: |-
|
||||
Defines the ending date of a OneTime schedule. It must be
|
||||
a RFC3339 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
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
|
||||
endTime:
|
||||
description: The endTime has the format HH:MM
|
||||
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||
type: string
|
||||
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:
|
||||
- type
|
||||
- value
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- schedules
|
||||
type: object
|
||||
status:
|
||||
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
|
||||
properties:
|
||||
active:
|
||||
default: false
|
||||
description: |-
|
||||
Active is true if at least one of the schedules defined in the
|
||||
scaling schedule is currently active.
|
||||
type: boolean
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
{{- end}}
|
@ -4,7 +4,7 @@ replicas: 1
|
||||
|
||||
registry:
|
||||
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
|
||||
imageTag: v0.2.3
|
||||
imageTag: v0.1.9
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
@ -14,15 +14,14 @@ service:
|
||||
addDirectoryHeader:
|
||||
contentionProfiling:
|
||||
profiling:
|
||||
enableCustomMetricsApi: true
|
||||
enableExternalMetricsApi: true
|
||||
enableCustomMetricsApi:
|
||||
enableExternalMetricsApi:
|
||||
credentialsDirectory:
|
||||
disregardIncompatibleHPAs:
|
||||
http2MaxStreamsPerConnection:
|
||||
listerKubeConfig:
|
||||
skipperBackendsAnnotation:
|
||||
skipperIngressMetrics:
|
||||
skipperRouteGroupMetrics: true
|
||||
token:
|
||||
vmodule:
|
||||
|
||||
@ -93,17 +92,3 @@ resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
scalingSchedule:
|
||||
enabled: true
|
||||
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
priorityClassName: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
@ -64,22 +64,12 @@ rules:
|
||||
- statefulsets
|
||||
verbs:
|
||||
- get
|
||||
# only relevant if running with the flag:
|
||||
# --skipper-ingress-metrics
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
- extensions
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
# only relevant if running with the flag:
|
||||
# --skipper-routegroup-metrics
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- routegroups
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- autoscaling
|
||||
resources:
|
||||
@ -88,22 +78,6 @@ rules:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules
|
||||
- scalingschedules
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules/status
|
||||
- scalingschedules/status
|
||||
verbs:
|
||||
- update
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
|
@ -1,157 +0,0 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.5
|
||||
name: scalingschedules.zalando.org
|
||||
spec:
|
||||
group: zalando.org
|
||||
names:
|
||||
categories:
|
||||
- all
|
||||
kind: ScalingSchedule
|
||||
listKind: ScalingScheduleList
|
||||
plural: scalingschedules
|
||||
singular: scalingschedule
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- description: Whether one or more schedules are currently active.
|
||||
jsonPath: .status.active
|
||||
name: Active
|
||||
type: boolean
|
||||
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 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
durationMinutes:
|
||||
description: |-
|
||||
The duration in minutes (default 0) that the configured value will be
|
||||
returned for the defined schedule.
|
||||
type: integer
|
||||
endDate:
|
||||
description: |-
|
||||
Defines the ending date of a OneTime schedule. It must be
|
||||
a RFC3339 formatted date.
|
||||
format: date-time
|
||||
type: string
|
||||
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
|
||||
endTime:
|
||||
description: The endTime has the format HH:MM
|
||||
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
||||
type: string
|
||||
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:
|
||||
- type
|
||||
- value
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- schedules
|
||||
type: object
|
||||
status:
|
||||
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
|
||||
properties:
|
||||
active:
|
||||
default: false
|
||||
description: |-
|
||||
Active is true if at least one of the schedules defined in the
|
||||
scaling schedule is currently active.
|
||||
type: boolean
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
@ -1,5 +1,5 @@
|
||||
FROM registry.opensource.zalan.do/library/alpine-3:latest
|
||||
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
||||
FROM registry.opensource.zalan.do/stups/alpine:latest
|
||||
MAINTAINER Team Teapot @ Zalando SE <team-teapot@zalando.de>
|
||||
|
||||
# add binary
|
||||
ADD build/linux/custom-metrics-consumer /
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: autoscaling/v2
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: custom-metrics-consumer
|
||||
@ -39,7 +39,7 @@ spec:
|
||||
- type: Object
|
||||
object:
|
||||
describedObject:
|
||||
apiVersion: networking.k8s.io/v1
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
name: custom-metrics-consumer
|
||||
metric:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user