mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2025-05-15 09:46:37 +00:00
Compare commits
2 Commits
v0.2.2
...
automate/r
Author | SHA1 | Date | |
---|---|---|---|
37547ce460 | |||
7a0c251972 |
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 }}
|
|
72
.github/workflows/codeql-analysis.yml
vendored
72
.github/workflows/codeql-analysis.yml
vendored
@ -1,72 +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@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
|
|
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/
|
build/
|
||||||
apiserver.local.config/
|
apiserver.local.config/
|
||||||
.idea/
|
.idea/
|
||||||
profile.cov
|
|
||||||
vendor/
|
vendor/
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
run:
|
run:
|
||||||
concurrency: 4
|
linters-settings:
|
||||||
|
golint:
|
||||||
|
min-confidence: 0.9
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
- errcheck
|
- staticcheck
|
||||||
- gosimple
|
- ineffassign
|
||||||
- govet
|
- golint
|
||||||
- ineffassign
|
- goimports
|
||||||
- staticcheck
|
- errcheck
|
||||||
- typecheck
|
issues:
|
||||||
- unused
|
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"`
|
- Make sure you sign-off on your commits `git commit -s -m "adding X to change Y"`
|
||||||
- Write good commit messages (see below).
|
- Write good commit messages (see below).
|
||||||
- Push your changes to a topic branch in your fork of the repository.
|
- 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
|
- 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
|
- 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)
|
- Your pull request must receive a :thumbsup: from two [maintainers](MAINTAINERS)
|
||||||
|
10
Dockerfile
10
Dockerfile
@ -1,11 +1,7 @@
|
|||||||
ARG BASE_IMAGE=registry.opensource.zalan.do/library/alpine-3:latest
|
FROM registry.opensource.zalan.do/library/alpine-3.12:latest
|
||||||
FROM ${BASE_IMAGE}
|
|
||||||
LABEL 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 build/linux/kube-metrics-adapter /
|
||||||
ARG TARGETARCH
|
|
||||||
|
|
||||||
ADD build/linux/${TARGETARCH}/kube-metrics-adapter /
|
|
||||||
|
|
||||||
ENTRYPOINT ["/kube-metrics-adapter"]
|
ENTRYPOINT ["/kube-metrics-adapter"]
|
||||||
|
37
Makefile
37
Makefile
@ -10,10 +10,6 @@ GOPKGS = $(shell go list ./...)
|
|||||||
BUILD_FLAGS ?= -v
|
BUILD_FLAGS ?= -v
|
||||||
OPENAPI ?= pkg/api/generated/openapi/zz_generated.openapi.go
|
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
|
||||||
@ -22,22 +18,14 @@ clean:
|
|||||||
rm -rf build
|
rm -rf build
|
||||||
rm -rf $(OPENAPI)
|
rm -rf $(OPENAPI)
|
||||||
|
|
||||||
test: $(GENERATED)
|
test:
|
||||||
go test -v -coverprofile=profile.cov $(GOPKGS)
|
go test -v $(GOPKGS)
|
||||||
|
|
||||||
check: $(GENERATED)
|
check:
|
||||||
go mod download
|
go mod download
|
||||||
golangci-lint run --timeout=2m ./...
|
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 || /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
|
$(OPENAPI): go.mod
|
||||||
go run k8s.io/kube-openapi/cmd/openapi-gen \
|
go run k8s.io/kube-openapi/cmd/openapi-gen \
|
||||||
--go-header-file hack/boilerplate.go.txt \
|
--go-header-file hack/boilerplate.go.txt \
|
||||||
@ -48,26 +36,21 @@ $(OPENAPI): go.mod
|
|||||||
-O zz_generated.openapi \
|
-O zz_generated.openapi \
|
||||||
-r /dev/null
|
-r /dev/null
|
||||||
|
|
||||||
build.local: build/$(BINARY) $(GENERATED_CRDS)
|
build.local: build/$(BINARY)
|
||||||
build.linux: build/linux/$(BINARY)
|
build.linux: build/linux/$(BINARY)
|
||||||
build.linux.amd64: build/linux/amd64/$(BINARY)
|
build.osx: build/osx/$(BINARY)
|
||||||
build.linux.arm64: build/linux/arm64/$(BINARY)
|
|
||||||
|
|
||||||
|
build/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||||
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) $(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)" .
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||||
|
|
||||||
build/linux/amd64/$(BINARY): go.mod $(SOURCES)
|
build/osx/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/amd64/$(BINARY) -ldflags "$(LDFLAGS)" .
|
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(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.docker: build.linux
|
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
|
build.push: build.docker
|
||||||
docker push "$(IMAGE):$(TAG)"
|
docker push "$(IMAGE):$(TAG)"
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
version: "2017-09-20"
|
version: "2017-09-20"
|
||||||
pipeline:
|
pipeline:
|
||||||
- id: build
|
- id: build
|
||||||
vm_config:
|
overlay: ci/golang
|
||||||
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
|
||||||
@ -22,7 +20,15 @@ pipeline:
|
|||||||
cmd: |
|
cmd: |
|
||||||
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
||||||
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter
|
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
|
else
|
||||||
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test
|
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test
|
||||||
VERSION=$CDP_BUILD_VERSION
|
VERSION=$CDP_BUILD_VERSION
|
||||||
@ -30,17 +36,18 @@ pipeline:
|
|||||||
IMAGE=$IMAGE VERSION=$VERSION make build.docker
|
IMAGE=$IMAGE VERSION=$VERSION make build.docker
|
||||||
git diff --stat --exit-code
|
git diff --stat --exit-code
|
||||||
IMAGE=$IMAGE VERSION=$VERSION make build.push
|
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
|
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
||||||
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter
|
echo "create release page"
|
||||||
VERSION=$(git describe --tags --always)
|
tf=$(mktemp)
|
||||||
else
|
echo -e "### Changes\n" >$tf
|
||||||
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter-test
|
git log -1 --pretty=%B | grep -v 'Signed-off-by:' | grep -v -E '^\s*$' | grep -vE '^\*' >>$tf
|
||||||
VERSION=$CDP_BUILD_VERSION
|
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
|
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/alpine-3:latest -t "${IMAGE}:${VERSION}" --platform linux/amd64,linux/arm64 --push .
|
|
||||||
cdp-promote-image "${IMAGE}:${VERSION}"
|
|
||||||
|
@ -1,142 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
controller-gen.kubebuilder.io/version: v0.9.0
|
|
||||||
creationTimestamp: null
|
|
||||||
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
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.custom.metrics.k8s.io
|
name: v1beta1.custom.metrics.k8s.io
|
||||||
|
@ -22,13 +22,12 @@ spec:
|
|||||||
serviceAccountName: custom-metrics-apiserver
|
serviceAccountName: custom-metrics-apiserver
|
||||||
containers:
|
containers:
|
||||||
- name: kube-metrics-adapter
|
- name: kube-metrics-adapter
|
||||||
image: ghcr.io/zalando-incubator/kube-metrics-adapter:latest
|
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter:latest
|
||||||
args:
|
args:
|
||||||
# - --v=9
|
# - --v=9
|
||||||
- --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/v1
|
apiVersion: apiregistration.k8s.io/v1beta1
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.external.metrics.k8s.io
|
name: v1beta1.external.metrics.k8s.io
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: kube-metrics-adapter
|
name: kube-metrics-adapter
|
||||||
version: 0.2.0
|
version: 0.1.9
|
||||||
description: kube-metrics-adapter helm chart
|
description: kube-metrics-adapter helm chart
|
||||||
home: https://github.com/zalando-incubator/kube-metrics-adapter
|
home: https://github.com/zalando-incubator/kube-metrics-adapter
|
||||||
maintainers:
|
maintainers:
|
||||||
|
@ -1,149 +0,0 @@
|
|||||||
{{- if .Values.scalingSchedule.enabled }}
|
|
||||||
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:
|
|
||||||
- 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: {}
|
|
||||||
status:
|
|
||||||
acceptedNames:
|
|
||||||
kind: ""
|
|
||||||
plural: ""
|
|
||||||
conditions: []
|
|
||||||
storedVersions: []
|
|
||||||
{{- end}}
|
|
@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.enableCustomMetricsApi }}
|
{{- if .Values.enableCustomMetricsApi }}
|
||||||
apiVersion: apiregistration.k8s.io/v1
|
apiVersion: apiregistration.k8s.io/v1beta1
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.custom.metrics.k8s.io
|
name: v1beta1.custom.metrics.k8s.io
|
||||||
@ -12,4 +12,4 @@ spec:
|
|||||||
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
||||||
groupPriorityMinimum: 100
|
groupPriorityMinimum: 100
|
||||||
versionPriority: 100
|
versionPriority: 100
|
||||||
{{- end}}
|
{{- end}}
|
@ -16,23 +16,8 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
application: kube-metrics-adapter
|
application: kube-metrics-adapter
|
||||||
version: {{ .Values.registry.imageTag }}
|
version: {{ .Values.registry.imageTag }}
|
||||||
{{- if .Values.podAnnotations }}
|
|
||||||
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: kube-metrics-adapter
|
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:
|
containers:
|
||||||
- name: kube-metrics-adapter
|
- name: kube-metrics-adapter
|
||||||
image: {{ .Values.registry.image}}:{{ .Values.registry.imageTag }}
|
image: {{ .Values.registry.image}}:{{ .Values.registry.imageTag }}
|
||||||
@ -164,9 +149,6 @@ spec:
|
|||||||
{{- if .Values.skipperIngressMetrics }}
|
{{- if .Values.skipperIngressMetrics }}
|
||||||
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
|
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- if .Values.skipperRouteGroupMetrics }}
|
|
||||||
- --skipper-routegroup-metrics={{ .Values.skipperRouteGroupMetrics }}
|
|
||||||
{{- end}}
|
|
||||||
{{- if .Values.log.stderrThreshold }}
|
{{- if .Values.log.stderrThreshold }}
|
||||||
- --stderrthreshold={{ .Values.log.stderrThreshold }}
|
- --stderrthreshold={{ .Values.log.stderrThreshold }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
@ -200,9 +182,6 @@ spec:
|
|||||||
{{- if .Values.zmon.tokenName }}
|
{{- if .Values.zmon.tokenName }}
|
||||||
- --zmon-token-name={{ .Values.zmon.tokenName }}
|
- --zmon-token-name={{ .Values.zmon.tokenName }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- if .Values.scalingSchedule.enabled }}
|
|
||||||
- --scaling-schedule
|
|
||||||
{{- end}}
|
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: {{ .Values.resources.limits.cpu }}
|
cpu: {{ .Values.resources.limits.cpu }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.enableExternalMetricsApi }}
|
{{- if .Values.enableExternalMetricsApi }}
|
||||||
apiVersion: apiregistration.k8s.io/v1
|
apiVersion: apiregistration.k8s.io/v1beta1
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1beta1.external.metrics.k8s.io
|
name: v1beta1.external.metrics.k8s.io
|
||||||
|
@ -59,22 +59,12 @@ rules:
|
|||||||
- statefulsets
|
- statefulsets
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
{{- if .Values.skipperRouteGroupMetrics }}
|
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- networking.k8s.io
|
- extensions
|
||||||
resources:
|
resources:
|
||||||
- ingresses
|
- ingresses
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.skipperRouteGroupMetrics }}
|
|
||||||
- apiGroups:
|
|
||||||
- zalando.org
|
|
||||||
resources:
|
|
||||||
- routegroups
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
{{- end }}
|
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- autoscaling
|
- autoscaling
|
||||||
resources:
|
resources:
|
||||||
@ -83,24 +73,6 @@ rules:
|
|||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- 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
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
@ -1,151 +0,0 @@
|
|||||||
{{- if .Values.scalingSchedule.enabled }}
|
|
||||||
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:
|
|
||||||
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: {}
|
|
||||||
status:
|
|
||||||
acceptedNames:
|
|
||||||
kind: ""
|
|
||||||
plural: ""
|
|
||||||
conditions: []
|
|
||||||
storedVersions: []
|
|
||||||
{{- end}}
|
|
@ -4,7 +4,7 @@ replicas: 1
|
|||||||
|
|
||||||
registry:
|
registry:
|
||||||
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
|
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
|
||||||
imageTag: v0.2.0
|
imageTag: v0.1.9
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@ -22,7 +22,6 @@ http2MaxStreamsPerConnection:
|
|||||||
listerKubeConfig:
|
listerKubeConfig:
|
||||||
skipperBackendsAnnotation:
|
skipperBackendsAnnotation:
|
||||||
skipperIngressMetrics:
|
skipperIngressMetrics:
|
||||||
skipperRouteGroupMetrics:
|
|
||||||
token:
|
token:
|
||||||
vmodule:
|
vmodule:
|
||||||
|
|
||||||
@ -93,17 +92,3 @@ resources:
|
|||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
|
|
||||||
scalingSchedule:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
nodeSelector:
|
|
||||||
kubernetes.io/os: linux
|
|
||||||
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
affinity: {}
|
|
||||||
|
|
||||||
priorityClassName: ""
|
|
||||||
|
|
||||||
podAnnotations: {}
|
|
||||||
|
@ -64,22 +64,12 @@ rules:
|
|||||||
- statefulsets
|
- statefulsets
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
# only relevant if running with the flag:
|
|
||||||
# --skipper-ingress-metrics
|
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- networking.k8s.io
|
- extensions
|
||||||
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:
|
||||||
@ -88,22 +78,6 @@ rules:
|
|||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- 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
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
@ -1,144 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
controller-gen.kubebuilder.io/version: v0.9.0
|
|
||||||
creationTimestamp: null
|
|
||||||
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
|
FROM registry.opensource.zalan.do/stups/alpine:latest
|
||||||
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
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 /
|
||||||
|
@ -39,7 +39,7 @@ spec:
|
|||||||
- type: Object
|
- type: Object
|
||||||
object:
|
object:
|
||||||
describedObject:
|
describedObject:
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: extensions/v1beta1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
name: custom-metrics-consumer
|
name: custom-metrics-consumer
|
||||||
metric:
|
metric:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: extensions/v1beta1
|
||||||
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