mirror of
https://github.com/holos-run/holos.git
synced 2026-03-19 16:54:58 +00:00
Compare commits
288 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad70a6c4fe | ||
|
|
22a04da6bb | ||
|
|
dc97fe0ff0 | ||
|
|
9ca97c6e01 | ||
|
|
924653e240 | ||
|
|
59d48f8599 | ||
|
|
90f8eab816 | ||
|
|
9ae45e260d | ||
|
|
aee15f95e2 | ||
|
|
1c540ac375 | ||
|
|
5b0e883ac9 | ||
|
|
9a2519af71 | ||
|
|
9b9ff601c0 | ||
|
|
2f798296dc | ||
|
|
2b2ff63cad | ||
|
|
3b135c09f3 | ||
|
|
28813eba5b | ||
|
|
02ff765f54 | ||
|
|
fe8a806132 | ||
|
|
6626d58301 | ||
|
|
cb0911e890 | ||
|
|
3745a68dc5 | ||
|
|
fd64830476 | ||
|
|
1ee0fa9c1f | ||
|
|
8fab325b0a | ||
|
|
858ffad913 | ||
|
|
62735b99e7 | ||
|
|
29ab9c6300 | ||
|
|
debc01c7de | ||
|
|
c07f35ecd6 | ||
|
|
c8f528700c | ||
|
|
896248c237 | ||
|
|
74a181db21 | ||
|
|
ba10113342 | ||
|
|
eb0207c92e | ||
|
|
0fbcee8119 | ||
|
|
ce8bc798f6 | ||
|
|
996195d651 | ||
|
|
f00b29d3a3 | ||
|
|
a6756ecf11 | ||
|
|
ef7ec30037 | ||
|
|
1642787825 | ||
|
|
f83781480f | ||
|
|
9b70205855 | ||
|
|
0e4bf3c144 | ||
|
|
1241c74b41 | ||
|
|
44fea098de | ||
|
|
52286efa25 | ||
|
|
a1b2179442 | ||
|
|
cffc430738 | ||
|
|
d76454272b | ||
|
|
9d1e77c00f | ||
|
|
2050abdc6c | ||
|
|
3ea013c503 | ||
|
|
309db96138 | ||
|
|
283b4be71c | ||
|
|
ab9bca0750 | ||
|
|
ac2be67c3c | ||
|
|
6ffafb8cca | ||
|
|
590e6b556c | ||
|
|
5dc5c6fbdf | ||
|
|
cd8c9f2c32 | ||
|
|
3490941d4c | ||
|
|
3f201df0c2 | ||
|
|
4c22d515bd | ||
|
|
ec0ef1c4b3 | ||
|
|
1e51e2d49a | ||
|
|
5186499b90 | ||
|
|
fc275e4164 | ||
|
|
9fa466f7cf | ||
|
|
efd6f256a5 | ||
|
|
f7f9d6b5f0 | ||
|
|
0526062ab2 | ||
|
|
a1ededa722 | ||
|
|
9b09a02912 | ||
|
|
657a5e82a5 | ||
|
|
1eece02254 | ||
|
|
c866b47dcb | ||
|
|
ff52ec750b | ||
|
|
4184619afc | ||
|
|
954dbd1ec8 | ||
|
|
30b70e76aa | ||
|
|
ec6d112711 | ||
|
|
e796c6a763 | ||
|
|
be32201294 | ||
|
|
5ebc54b5b7 | ||
|
|
2954a57872 | ||
|
|
df705bd79f | ||
|
|
4e8ce3585d | ||
|
|
ab5f17c3d2 | ||
|
|
a8918c74d4 | ||
|
|
ae5738d82d | ||
|
|
bb99aedffa | ||
|
|
d6ee1864c8 | ||
|
|
8a4be66277 | ||
|
|
79ce2f8458 | ||
|
|
3d4ae44ddd | ||
|
|
1efb1faa40 | ||
|
|
bfd6a56397 | ||
|
|
a788f6d8e8 | ||
|
|
80fa91d74d | ||
|
|
db34562e9a | ||
|
|
d6af089ab3 | ||
|
|
b3a70c5911 | ||
|
|
bf5765c9cb | ||
|
|
6c7697648c | ||
|
|
04158485c7 | ||
|
|
cf83c77280 | ||
|
|
6e545b13dd | ||
|
|
bf258a1f41 | ||
|
|
6f06c73d6f | ||
|
|
a689c53a9c | ||
|
|
58cdda1d35 | ||
|
|
bcb02b5c5c | ||
|
|
0736c7de1a | ||
|
|
28be9f9fbb | ||
|
|
647681de38 | ||
|
|
81beb5c539 | ||
|
|
5c1e0a29c8 | ||
|
|
01ac5276a9 | ||
|
|
e40594ad8e | ||
|
|
bc9c6a622a | ||
|
|
17f22199b7 | ||
|
|
7e93fe4535 | ||
|
|
2e98df3572 | ||
|
|
3b561de413 | ||
|
|
0d0dae8742 | ||
|
|
61b4b5bd17 | ||
|
|
0060740b76 | ||
|
|
bf8a4af579 | ||
|
|
dc057fe39d | ||
|
|
9877ab131a | ||
|
|
13aba64cb7 | ||
|
|
fe9bc2dbfc | ||
|
|
c53b682852 | ||
|
|
3aca6a9e4c | ||
|
|
40fdfc0317 | ||
|
|
25d9415b0a | ||
|
|
43c8702398 | ||
|
|
ce94776dbb | ||
|
|
78ab6cd848 | ||
|
|
0a7001f868 | ||
|
|
2db7be671b | ||
|
|
b51870f7bf | ||
|
|
0227dfa7e5 | ||
|
|
05b59d9af0 | ||
|
|
04f9f3b3a8 | ||
|
|
b58be8b38c | ||
|
|
10493d754a | ||
|
|
cf28516b8b | ||
|
|
d81e25c4e4 | ||
|
|
c4612ff5d2 | ||
|
|
d70acbb47e | ||
|
|
3c977d22fe | ||
|
|
e34db2b583 | ||
|
|
71de57ac88 | ||
|
|
c7cc661018 | ||
|
|
09f39c02fe | ||
|
|
23c76a73e0 | ||
|
|
1cafe08237 | ||
|
|
45b07964ef | ||
|
|
6cc4a57b62 | ||
|
|
31280acbae | ||
|
|
6f0928b12c | ||
|
|
c6e9250d60 | ||
|
|
104bda459f | ||
|
|
bd2effa183 | ||
|
|
562412fbe7 | ||
|
|
fd6fbe5598 | ||
|
|
67472e1e1c | ||
|
|
d64c3e8c66 | ||
|
|
f344f97374 | ||
|
|
770088b912 | ||
|
|
cb9b39c3ca | ||
|
|
0f34b20546 | ||
|
|
0d7bbbb659 | ||
|
|
3f3e36bbe9 | ||
|
|
9f41478d33 | ||
|
|
b86fee04fc | ||
|
|
c78da6949f | ||
|
|
7b215bb8f1 | ||
|
|
78cec76a96 | ||
|
|
0e98ad2ecb | ||
|
|
30bb3f183a | ||
|
|
1369338f3c | ||
|
|
ac03f64724 | ||
|
|
bea4468972 | ||
|
|
224adffa15 | ||
|
|
b4d34ffdbc | ||
|
|
a85db9cf5e | ||
|
|
990c82432c | ||
|
|
e3673b594c | ||
|
|
f8cf278a24 | ||
|
|
b0bc596a49 | ||
|
|
4501ceec05 | ||
|
|
4183fdfd42 | ||
|
|
2595793019 | ||
|
|
aa3d1914b1 | ||
|
|
679ddbb6bf | ||
|
|
b1d7d07a04 | ||
|
|
5f58263232 | ||
|
|
b6bdd072f7 | ||
|
|
509f2141ac | ||
|
|
4c2bc34d58 | ||
|
|
d831070f53 | ||
|
|
340715f76c | ||
|
|
64ffacfc7a | ||
|
|
54acea42cb | ||
|
|
5ef8e75194 | ||
|
|
cb2b5c0f49 | ||
|
|
fd5a2fdbc1 | ||
|
|
eb3e272612 | ||
|
|
9f2a51bde8 | ||
|
|
2b3b5a4887 | ||
|
|
7426e8f867 | ||
|
|
cf0c455aa2 | ||
|
|
752a3f912d | ||
|
|
7d5852d675 | ||
|
|
66b4ca0e6c | ||
|
|
b3f682453d | ||
|
|
0c3181ae05 | ||
|
|
18cbff0c13 | ||
|
|
b4fca0929c | ||
|
|
911d65bdc6 | ||
|
|
2a5eccf0c1 | ||
|
|
9db4873205 | ||
|
|
f90e83e142 | ||
|
|
bdd2964edb | ||
|
|
56375b82d8 | ||
|
|
dc27489249 | ||
|
|
7d8a618e25 | ||
|
|
646f6fcdb0 | ||
|
|
4ce39db745 | ||
|
|
eba58d1639 | ||
|
|
765832d90d | ||
|
|
d1163d689a | ||
|
|
63009ba419 | ||
|
|
9c42cf9109 | ||
|
|
3fce5188a2 | ||
|
|
fde88ad5eb | ||
|
|
7a8d30f833 | ||
|
|
8987442b91 | ||
|
|
a6af3a46cf | ||
|
|
71d545a883 | ||
|
|
044d3082d9 | ||
|
|
c2d5c4ad36 | ||
|
|
ab03ef1052 | ||
|
|
8c76061b0d | ||
|
|
f60db8fa1f | ||
|
|
eefc092ea9 | ||
|
|
0860ac3409 | ||
|
|
6b156e9883 | ||
|
|
4de9f77fbf | ||
|
|
4c5429b64a | ||
|
|
ac5bff4b32 | ||
|
|
6090ab224e | ||
|
|
10e140258d | ||
|
|
40ac705f0d | ||
|
|
b4ad6425e5 | ||
|
|
3343d226e5 | ||
|
|
f3a9b7cfbc | ||
|
|
53b7246d5e | ||
|
|
c20872c92f | ||
|
|
ecce1f797e | ||
|
|
0d7033d063 | ||
|
|
84bf0c8945 | ||
|
|
466b48966a | ||
|
|
84bcf4b2d0 | ||
|
|
bdd76c78a7 | ||
|
|
95e0dfa44a | ||
|
|
90d70a6afa | ||
|
|
d0c2d85246 | ||
|
|
7e637b4647 | ||
|
|
9bc96d0783 | ||
|
|
ac72ac5ace | ||
|
|
51f22443f3 | ||
|
|
e98ee28f74 | ||
|
|
b16d3459f7 | ||
|
|
f41b883dce | ||
|
|
572281914c | ||
|
|
4cdf9d2dae | ||
|
|
29a4fae059 | ||
|
|
fd306aae76 | ||
|
|
e4875fe3a6 | ||
|
|
5bf2b85036 | ||
|
|
0771bd6b6c | ||
|
|
f647a4a76c | ||
|
|
37d5eac841 |
34
.github/workflows/lint.yaml
vendored
34
.github/workflows/lint.yaml
vendored
@@ -1,6 +1,7 @@
|
||||
---
|
||||
# https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#how-to-use
|
||||
name: Lint
|
||||
on:
|
||||
"on":
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -14,14 +15,35 @@ permissions:
|
||||
jobs:
|
||||
golangci:
|
||||
name: lint
|
||||
runs-on: [self-hosted, k8s]
|
||||
runs-on: gha-rs
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
cache: false
|
||||
|
||||
- name: Install Packages
|
||||
run: sudo apt update && sudo apt -qq -y install git curl zip unzip tar bzip2 make
|
||||
|
||||
- name: Install Tools
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v4
|
||||
with:
|
||||
version: latest
|
||||
skip-pkg-cache: true
|
||||
|
||||
39
.github/workflows/release.yaml
vendored
39
.github/workflows/release.yaml
vendored
@@ -1,34 +1,59 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
# Run only against tags
|
||||
tags:
|
||||
- '*'
|
||||
branches:
|
||||
- release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: [self-hosted, k8s]
|
||||
runs-on: gha-rs
|
||||
steps:
|
||||
# Must come before Checkout, otherwise goreleaser fails
|
||||
- name: Provide GPG and Git
|
||||
run: sudo apt update && sudo apt -qq -y install gnupg git curl zip unzip tar bzip2 make
|
||||
|
||||
# Must come after git executable is provided
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
|
||||
# Necessary to run these outside of goreleaser, otherwise
|
||||
# /home/runner/_work/holos/holos/internal/frontend/node_modules/.bin/protoc-gen-connect-query is not in PATH
|
||||
- name: Install Tools
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_CODE_SIGNING_SECRETKEY }}
|
||||
passphrase: ${{ secrets.GPG_CODE_SIGNING_PASSPHRASE }}
|
||||
|
||||
- name: List keys
|
||||
run: gpg -K
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
|
||||
25
.github/workflows/test.yaml
vendored
25
.github/workflows/test.yaml
vendored
@@ -13,15 +13,38 @@ permissions:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: [self-hosted, k8s]
|
||||
runs-on: gha-rs
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
|
||||
- name: Install Packages
|
||||
run: sudo apt update && sudo apt -qq -y install git curl zip unzip tar bzip2 make
|
||||
|
||||
- name: Set up Helm
|
||||
uses: azure/setup-helm@v4
|
||||
|
||||
- name: Set up Kubectl
|
||||
uses: azure/setup-kubectl@v3
|
||||
|
||||
- name: Install Tools
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: ./scripts/test
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,7 +1,8 @@
|
||||
bin/
|
||||
/bin/
|
||||
vendor/
|
||||
.idea/
|
||||
coverage.out
|
||||
dist/
|
||||
/dist/
|
||||
*.hold/
|
||||
/deploy/
|
||||
.vscode/
|
||||
|
||||
2
.golangci.yaml
Normal file
2
.golangci.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
run:
|
||||
timeout: 5m
|
||||
@@ -10,10 +10,8 @@ version: 1
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod tidy
|
||||
# you may remove this if you don't need go generate
|
||||
- go generate ./...
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- main: ./cmd/holos
|
||||
@@ -23,6 +21,9 @@ builds:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
signs:
|
||||
- artifacts: checksum
|
||||
|
||||
54
Makefile
54
Makefile
@@ -4,7 +4,7 @@ PROJ=holos
|
||||
ORG_PATH=github.com/holos-run
|
||||
REPO_PATH=$(ORG_PATH)/$(PROJ)
|
||||
|
||||
VERSION := $(shell grep "const Version " pkg/version/version.go | sed -E 's/.*"(.+)"$$/\1/')
|
||||
VERSION := $(shell cat version/embedded/major version/embedded/minor version/embedded/patch | xargs printf "%s.%s.%s")
|
||||
BIN_NAME := holos
|
||||
|
||||
DOCKER_REPO=quay.io/openinfrastructure/holos
|
||||
@@ -12,11 +12,14 @@ IMAGE_NAME=$(DOCKER_REPO)
|
||||
|
||||
$( shell mkdir -p bin)
|
||||
|
||||
# For buf plugin protoc-gen-connect-es
|
||||
export PATH := $(PWD)/internal/frontend/holos/node_modules/.bin:$(PATH)
|
||||
|
||||
GIT_COMMIT=$(shell git rev-parse HEAD)
|
||||
GIT_TREE_STATE=$(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
|
||||
BUILD_DATE=$(shell date -Iseconds)
|
||||
|
||||
LD_FLAGS="-w -X ${ORG_PATH}/${PROJ}/pkg/version.GitCommit=${GIT_COMMIT} -X ${ORG_PATH}/${PROJ}/pkg/version.GitTreeState=${GIT_TREE_STATE} -X ${ORG_PATH}/${PROJ}/pkg/version.BuildDate=${BUILD_DATE}"
|
||||
LD_FLAGS="-w -X ${ORG_PATH}/${PROJ}/version.GitCommit=${GIT_COMMIT} -X ${ORG_PATH}/${PROJ}/version.GitTreeState=${GIT_TREE_STATE} -X ${ORG_PATH}/${PROJ}/version.BuildDate=${BUILD_DATE}"
|
||||
|
||||
.PHONY: default
|
||||
default: test
|
||||
@@ -39,24 +42,33 @@ bumpmajor: ## Bump the major version.
|
||||
scripts/bump minor 0
|
||||
scripts/bump patch 0
|
||||
|
||||
.PHONY: show-version
|
||||
show-version: ## Print the full version.
|
||||
@echo $(VERSION)
|
||||
|
||||
.PHONY: tidy
|
||||
tidy: ## Tidy go module.
|
||||
go mod tidy
|
||||
|
||||
.PHONY: fmt
|
||||
fmt: ## Format Go code.
|
||||
fmt: ## Format code.
|
||||
cd docs/examples && cue fmt ./...
|
||||
go fmt ./...
|
||||
|
||||
.PHONY: vet
|
||||
vet: ## Vet Go code.
|
||||
go vet ./...
|
||||
|
||||
.PHONY: gencue
|
||||
gencue: ## Generate CUE definitions
|
||||
cd docs/examples && cue get go github.com/holos-run/holos/api/...
|
||||
|
||||
.PHONY: generate
|
||||
generate: ## Generate code.
|
||||
go generate ./...
|
||||
|
||||
.PHONY: build
|
||||
build: generate ## Build holos executable.
|
||||
build: generate frontend ## Build holos executable.
|
||||
@echo "building ${BIN_NAME} ${VERSION}"
|
||||
@echo "GOPATH=${GOPATH}"
|
||||
go build -trimpath -o bin/$(BIN_NAME) -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/$(BIN_NAME)
|
||||
@@ -85,6 +97,40 @@ coverage: test ## Test coverage profile.
|
||||
snapshot: ## Go release snapshot
|
||||
goreleaser release --snapshot --clean
|
||||
|
||||
.PHONY: buf
|
||||
buf: ## buf generate
|
||||
cd service && buf mod update
|
||||
buf generate
|
||||
|
||||
.PHONY: tools
|
||||
tools: go-deps frontend-deps ## install tool dependencies
|
||||
|
||||
.PHONY: go-deps
|
||||
go-deps: ## tool versions pinned in tools.go
|
||||
go install github.com/bufbuild/buf/cmd/buf
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
go install connectrpc.com/connect/cmd/protoc-gen-connect-go
|
||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
# curl https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash
|
||||
|
||||
.PHONY: frontend-deps
|
||||
frontend-deps: ## Setup npm and vite
|
||||
cd internal/frontend/holos && npm install
|
||||
cd internal/frontend/holos && npm install --save-dev @bufbuild/buf @connectrpc/protoc-gen-connect-es
|
||||
cd internal/frontend/holos && npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobuf
|
||||
# https://github.com/connectrpc/connect-query-es/blob/1350b6f07b6aead81793917954bdb1cc3ce09df9/packages/protoc-gen-connect-query/README.md?plain=1#L23
|
||||
cd internal/frontend/holos && npm install --save-dev @connectrpc/protoc-gen-connect-query @bufbuild/protoc-gen-es
|
||||
cd internal/frontend/holos && npm install @connectrpc/connect-query @bufbuild/protobuf
|
||||
|
||||
|
||||
.PHONY: frontend
|
||||
frontend: buf
|
||||
cd internal/frontend/holos && rm -rf dist
|
||||
mkdir -p internal/frontend/holos/dist
|
||||
cd internal/frontend/holos && ng build
|
||||
touch internal/frontend/frontend.go
|
||||
|
||||
.PHONY: help
|
||||
help: ## Display this help menu.
|
||||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||
|
||||
311
Tiltfile
Normal file
311
Tiltfile
Normal file
@@ -0,0 +1,311 @@
|
||||
# -*- mode: Python -*-
|
||||
# This Tiltfile manages a Go project with live leload in Kubernetes
|
||||
|
||||
listen_port = 3000
|
||||
metrics_port = 9090
|
||||
|
||||
# Use our wrapper to set the kube namespace
|
||||
if os.getenv('TILT_WRAPPER') != '1':
|
||||
fail("could not run, ./hack/tilt/bin/tilt was not used to start tilt")
|
||||
|
||||
# AWS Account to work in
|
||||
aws_account = '271053619184'
|
||||
aws_region = 'us-east-2'
|
||||
|
||||
# Resource ids
|
||||
holos_backend = 'Holos Backend'
|
||||
pg_admin = 'pgAdmin'
|
||||
pg_cluster = 'PostgresCluster'
|
||||
pg_svc = 'Database Pod'
|
||||
compile_id = 'Go Build'
|
||||
auth_id = 'Auth Policy'
|
||||
lint_id = 'Run Linters'
|
||||
tests_id = 'Run Tests'
|
||||
|
||||
# PostgresCluster resource name in k8s
|
||||
pg_cluster_name = 'holos'
|
||||
# Database name inside the PostgresCluster
|
||||
pg_database_name = 'holos'
|
||||
# PGAdmin name
|
||||
pg_admin_name = 'pgadmin'
|
||||
|
||||
# Default Registry.
|
||||
# See: https://github.com/tilt-dev/tilt.build/blob/master/docs/choosing_clusters.md#manual-configuration
|
||||
# Note, Tilt will append the image name to the registry uri path
|
||||
default_registry('{account}.dkr.ecr.{region}.amazonaws.com/holos-run/holos-server'.format(account=aws_account, region=aws_region))
|
||||
|
||||
# Set a name prefix specific to the user. Multiple developers share the tilt-holos namespace.
|
||||
developer = os.getenv('USER')
|
||||
holos_server = 'holos'
|
||||
# See ./hack/tilt/bin/tilt
|
||||
namespace = os.getenv('NAMESPACE')
|
||||
# We always develop against the k1 cluster.
|
||||
os.putenv('KUBECONFIG', os.path.abspath('./hack/tilt/kubeconfig'))
|
||||
# The context defined in ./hack/tilt/kubeconfig
|
||||
allow_k8s_contexts('sso@k1')
|
||||
allow_k8s_contexts('sso@k2')
|
||||
allow_k8s_contexts('sso@k3')
|
||||
allow_k8s_contexts('sso@k4')
|
||||
allow_k8s_contexts('sso@k5')
|
||||
# PG db connection for localhost -> k8s port-forward
|
||||
os.putenv('PGHOST', 'localhost')
|
||||
os.putenv('PGPORT', '15432')
|
||||
# We always develop in the dev aws account.
|
||||
os.putenv('AWS_CONFIG_FILE', os.path.abspath('./hack/tilt/aws.config'))
|
||||
os.putenv('AWS_ACCOUNT', aws_account)
|
||||
os.putenv('AWS_DEFAULT_REGION', aws_region)
|
||||
os.putenv('AWS_PROFILE', 'dev-holos')
|
||||
os.putenv('AWS_SDK_LOAD_CONFIG', '1')
|
||||
# Authenticate to AWS ECR when tilt up is run by the developer
|
||||
local_resource('AWS Credentials', './hack/tilt/aws-login.sh', auto_init=True)
|
||||
|
||||
# Extensions are open-source, pre-packaged functions that extend Tilt
|
||||
#
|
||||
# More info: https://github.com/tilt-dev/tilt-extensions
|
||||
# More info: https://docs.tilt.dev/extensions.html
|
||||
load('ext://restart_process', 'docker_build_with_restart')
|
||||
load('ext://k8s_attach', 'k8s_attach')
|
||||
load('ext://git_resource', 'git_checkout')
|
||||
load('ext://uibutton', 'cmd_button')
|
||||
|
||||
# Paths edited by the developer Tilt watches to trigger compilation.
|
||||
# Generated files should be excluded to avoid an infinite build loop.
|
||||
developer_paths = [
|
||||
'./cmd',
|
||||
'./internal/server',
|
||||
'./internal/ent/schema',
|
||||
'./frontend/package-lock.json',
|
||||
'./frontend/src',
|
||||
'./go.mod',
|
||||
'./pkg',
|
||||
'./service/holos',
|
||||
]
|
||||
|
||||
# Builds the holos-server executable
|
||||
local_resource(compile_id, 'make build', deps=developer_paths)
|
||||
|
||||
# Build Docker image
|
||||
# Tilt will automatically associate image builds with the resource(s)
|
||||
# that reference them (e.g. via Kubernetes or Docker Compose YAML).
|
||||
#
|
||||
# More info: https://docs.tilt.dev/api.html#api.docker_build
|
||||
#
|
||||
docker_build_with_restart(
|
||||
'holos',
|
||||
context='.',
|
||||
entrypoint=[
|
||||
'/app/bin/holos',
|
||||
'server',
|
||||
'--listen-port={}'.format(listen_port),
|
||||
'--oidc-issuer=https://login.ois.run',
|
||||
'--oidc-audience=262096764402729854@holos_platform',
|
||||
'--log-level=debug',
|
||||
'--metrics-port={}'.format(metrics_port),
|
||||
],
|
||||
dockerfile='./hack/tilt/Dockerfile',
|
||||
only=['./bin'],
|
||||
# (Recommended) Updating a running container in-place
|
||||
# https://docs.tilt.dev/live_update_reference.html
|
||||
live_update=[
|
||||
# Sync files from host to container
|
||||
sync('./bin', '/app/bin'),
|
||||
# Wait for aws-login https://github.com/tilt-dev/tilt/issues/3048
|
||||
sync('./tilt/aws-login.last', '/dev/null'),
|
||||
# Execute commands in the container when paths change
|
||||
# run('/app/hack/codegen.sh', trigger=['./app/api'])
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
# Run local commands
|
||||
# Local commands can be helpful for one-time tasks like installing
|
||||
# project prerequisites. They can also manage long-lived processes
|
||||
# for non-containerized services or dependencies.
|
||||
#
|
||||
# More info: https://docs.tilt.dev/local_resource.html
|
||||
#
|
||||
# local_resource('install-helm',
|
||||
# cmd='which helm > /dev/null || brew install helm',
|
||||
# # `cmd_bat`, when present, is used instead of `cmd` on Windows.
|
||||
# cmd_bat=[
|
||||
# 'powershell.exe',
|
||||
# '-Noninteractive',
|
||||
# '-Command',
|
||||
# '& {if (!(Get-Command helm -ErrorAction SilentlyContinue)) {scoop install helm}}'
|
||||
# ]
|
||||
# )
|
||||
|
||||
# Teach tilt about our custom resources (Note, this may be intended for workloads)
|
||||
# k8s_kind('authorizationpolicy')
|
||||
# k8s_kind('requestauthentication')
|
||||
# k8s_kind('virtualservice')
|
||||
k8s_kind('pgadmin')
|
||||
|
||||
|
||||
# Troubleshooting
|
||||
def resource_name(id):
|
||||
print('resource: {}'.format(id))
|
||||
return id.name
|
||||
|
||||
|
||||
workload_to_resource_function(resource_name)
|
||||
|
||||
# Apply Kubernetes manifests
|
||||
# Tilt will build & push any necessary images, re-deploying your
|
||||
# resources as they change.
|
||||
#
|
||||
# More info: https://docs.tilt.dev/api.html#api.k8s_yaml
|
||||
#
|
||||
|
||||
def holos_yaml():
|
||||
"""Return a k8s Deployment personalized for the developer."""
|
||||
k8s_yaml_template = str(read_file('./hack/tilt/k8s.yaml'))
|
||||
return k8s_yaml_template.format(
|
||||
name=holos_server,
|
||||
developer=developer,
|
||||
namespace=namespace,
|
||||
listen_port=listen_port,
|
||||
metrics_port=metrics_port,
|
||||
tz=os.getenv('TZ'),
|
||||
)
|
||||
|
||||
# Customize a Kubernetes resource
|
||||
# By default, Kubernetes resource names are automatically assigned
|
||||
# based on objects in the YAML manifests, e.g. Deployment name.
|
||||
#
|
||||
# Tilt strives for sane defaults, so calling k8s_resource is
|
||||
# optional, and you only need to pass the arguments you want to
|
||||
# override.
|
||||
#
|
||||
# More info: https://docs.tilt.dev/api.html#api.k8s_resource
|
||||
#
|
||||
k8s_yaml(blob(holos_yaml()))
|
||||
|
||||
# Backend server process
|
||||
k8s_resource(
|
||||
workload=holos_server,
|
||||
new_name=holos_backend,
|
||||
objects=[
|
||||
'{}:serviceaccount'.format(holos_server),
|
||||
'{}:servicemonitor'.format(holos_server),
|
||||
],
|
||||
resource_deps=[compile_id],
|
||||
links=[
|
||||
link('https://{}.app.dev.k2.holos.run/ui/'.format(developer), "Holos Web UI")
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
# AuthorizationPolicy - Beyond Corp functionality
|
||||
k8s_resource(
|
||||
new_name=auth_id,
|
||||
objects=[
|
||||
'{}:virtualservice'.format(holos_server),
|
||||
],
|
||||
)
|
||||
|
||||
# Database
|
||||
# Note: Tilt confuses the backup pods with the database server pods, so this code is careful to tease the pods
|
||||
# apart so logs are streamed correctly.
|
||||
# See: https://github.com/tilt-dev/tilt.specs/blob/master/resource_assembly.md
|
||||
|
||||
# pgAdmin Web UI
|
||||
k8s_resource(
|
||||
workload=pg_admin_name,
|
||||
new_name=pg_admin,
|
||||
port_forwards=[
|
||||
port_forward(15050, 5050, pg_admin),
|
||||
],
|
||||
)
|
||||
|
||||
# Disabled because these don't group resources nicely
|
||||
# k8s_kind('postgrescluster')
|
||||
|
||||
# Postgres database in-cluster
|
||||
k8s_resource(
|
||||
new_name=pg_cluster,
|
||||
objects=['holos:postgrescluster'],
|
||||
)
|
||||
|
||||
# Needed to select the database by label
|
||||
# https://docs.tilt.dev/api.html#api.k8s_custom_deploy
|
||||
k8s_custom_deploy(
|
||||
pg_svc,
|
||||
apply_cmd=['./hack/tilt/k8s-get-db-sts', pg_cluster_name],
|
||||
delete_cmd=['echo', 'Skipping delete. Object managed by custom resource.'],
|
||||
deps=[],
|
||||
)
|
||||
k8s_resource(
|
||||
pg_svc,
|
||||
port_forwards=[
|
||||
port_forward(15432, 5432, 'psql'),
|
||||
],
|
||||
resource_deps=[pg_cluster]
|
||||
)
|
||||
|
||||
|
||||
# Run tests
|
||||
local_resource(
|
||||
tests_id,
|
||||
'make test',
|
||||
allow_parallel=True,
|
||||
auto_init=False,
|
||||
deps=developer_paths,
|
||||
)
|
||||
|
||||
# Run linter
|
||||
local_resource(
|
||||
lint_id,
|
||||
'make lint',
|
||||
allow_parallel=True,
|
||||
auto_init=False,
|
||||
deps=developer_paths,
|
||||
)
|
||||
|
||||
# UI Buttons for helpful things.
|
||||
# Icons: https://fonts.google.com/icons
|
||||
os.putenv("GH_FORCE_TTY", "80%")
|
||||
cmd_button(
|
||||
'{}:go-test-failfast'.format(tests_id),
|
||||
argv=['./hack/tilt/go-test-failfast'],
|
||||
resource=tests_id,
|
||||
icon_name='quiz',
|
||||
text='Fail Fast',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:issues'.format(holos_server),
|
||||
argv=['./hack/tilt/gh-issues'],
|
||||
resource=holos_backend,
|
||||
icon_name='folder_data',
|
||||
text='Issues',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:gh-issue-view'.format(holos_server),
|
||||
argv=['./hack/tilt/gh-issue-view'],
|
||||
resource=holos_backend,
|
||||
icon_name='task',
|
||||
text='View Issue',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgdb-creds'.format(holos_server),
|
||||
argv=['./hack/tilt/get-pgdb-creds', pg_cluster_name, pg_database_name],
|
||||
resource=pg_svc,
|
||||
icon_name='lock_open_right',
|
||||
text='DB Creds',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgdb-creds'.format(pg_admin_name),
|
||||
argv=['./hack/tilt/get-pgdb-creds', pg_cluster_name, pg_database_name],
|
||||
resource=pg_admin,
|
||||
icon_name='lock_open_right',
|
||||
text='DB Creds',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgadmin-creds'.format(pg_admin_name),
|
||||
argv=['./hack/tilt/get-pgadmin-creds', pg_admin_name],
|
||||
resource=pg_admin,
|
||||
icon_name='lock_open_right',
|
||||
text='pgAdmin Login',
|
||||
)
|
||||
|
||||
print("✨ Tiltfile evaluated")
|
||||
41
api/v1alpha1/buildplan.go
Normal file
41
api/v1alpha1/buildplan.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// BuildPlan is the primary interface between CUE and the Holos cli.
|
||||
type BuildPlan struct {
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
// Metadata represents the holos component name
|
||||
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
||||
Spec BuildPlanSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
|
||||
Platform map[string]any `json:"platform,omitempty" yaml:"platform,omitempty"`
|
||||
}
|
||||
|
||||
type BuildPlanSpec struct {
|
||||
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
|
||||
Components BuildPlanComponents `json:"components,omitempty" yaml:"components,omitempty"`
|
||||
}
|
||||
|
||||
type BuildPlanComponents struct {
|
||||
HelmChartList []HelmChart `json:"helmChartList,omitempty" yaml:"helmChartList,omitempty"`
|
||||
KubernetesObjectsList []KubernetesObjects `json:"kubernetesObjectsList,omitempty" yaml:"kubernetesObjectsList,omitempty"`
|
||||
KustomizeBuildList []KustomizeBuild `json:"kustomizeBuildList,omitempty" yaml:"kustomizeBuildList,omitempty"`
|
||||
Resources map[string]KubernetesObjects `json:"resources,omitempty" yaml:"resources,omitempty"`
|
||||
}
|
||||
|
||||
func (bp *BuildPlan) Validate() error {
|
||||
errs := make([]string, 0, 2)
|
||||
if bp.Kind != BuildPlanKind {
|
||||
errs = append(errs, fmt.Sprintf("kind invalid: want: %s have: %s", BuildPlanKind, bp.Kind))
|
||||
}
|
||||
if bp.APIVersion != APIVersion {
|
||||
errs = append(errs, fmt.Sprintf("apiVersion invalid: want: %s have: %s", APIVersion, bp.APIVersion))
|
||||
}
|
||||
if len(errs) > 0 {
|
||||
return fmt.Errorf("invalid BuildPlan: " + strings.Join(errs, ", "))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
22
api/v1alpha1/component.go
Normal file
22
api/v1alpha1/component.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package v1alpha1
|
||||
|
||||
// HolosComponent defines the fields common to all holos component kinds including the Render Result.
|
||||
type HolosComponent struct {
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
// Metadata represents the holos component name
|
||||
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
||||
// APIObjectMap holds the marshalled representation of api objects. Think of
|
||||
// these as resources overlaid at the back of the render pipeline.
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap,omitempty" yaml:"apiObjectMap,omitempty"`
|
||||
// Kustomization holds the marshalled representation of the flux kustomization
|
||||
// which reconciles resources in git with the api server.
|
||||
Kustomization `json:",inline" yaml:",inline"`
|
||||
// Kustomize represents a kubectl kustomize build post-processing step.
|
||||
Kustomize `json:",inline" yaml:",inline"`
|
||||
// Skip causes holos to take no action regarding the component.
|
||||
Skip bool
|
||||
}
|
||||
|
||||
func (hc *HolosComponent) NewResult() *Result {
|
||||
return &Result{HolosComponent: *hc}
|
||||
}
|
||||
11
api/v1alpha1/constants.go
Normal file
11
api/v1alpha1/constants.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package v1alpha1
|
||||
|
||||
const (
|
||||
APIVersion = "holos.run/v1alpha1"
|
||||
BuildPlanKind = "BuildPlan"
|
||||
HelmChartKind = "HelmChart"
|
||||
// ChartDir is the directory name created in the holos component directory to cache a chart.
|
||||
ChartDir = "vendor"
|
||||
// ResourcesFile is the file name used to store component output when post-processing with kustomize.
|
||||
ResourcesFile = "resources.yaml"
|
||||
)
|
||||
2
api/v1alpha1/doc.go
Normal file
2
api/v1alpha1/doc.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// Package v1alpha1 defines the api boundary between CUE and Holos.
|
||||
package v1alpha1
|
||||
170
api/v1alpha1/helm.go
Normal file
170
api/v1alpha1/helm.go
Normal file
@@ -0,0 +1,170 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/holos-run/holos"
|
||||
"github.com/holos-run/holos/internal/errors"
|
||||
"github.com/holos-run/holos/internal/logger"
|
||||
"github.com/holos-run/holos/internal/util"
|
||||
)
|
||||
|
||||
// A HelmChart represents a helm command to provide chart values in order to render kubernetes api objects.
|
||||
type HelmChart struct {
|
||||
HolosComponent `json:",inline" yaml:",inline"`
|
||||
// Namespace is the namespace to install into. TODO: Use metadata.namespace instead.
|
||||
Namespace string `json:"namespace"`
|
||||
Chart Chart `json:"chart"`
|
||||
ValuesContent string `json:"valuesContent"`
|
||||
EnableHooks bool `json:"enableHooks"`
|
||||
}
|
||||
|
||||
type Chart struct {
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
Release string `json:"release"`
|
||||
Repository Repository `json:"repository,omitempty"`
|
||||
}
|
||||
|
||||
type Repository struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
func (hc *HelmChart) Render(ctx context.Context, path holos.InstancePath) (*Result, error) {
|
||||
result := Result{HolosComponent: hc.HolosComponent}
|
||||
if err := hc.helm(ctx, &result, path); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result.addObjectMap(ctx, hc.APIObjectMap)
|
||||
if err := result.kustomize(ctx); err != nil {
|
||||
return nil, errors.Wrap(fmt.Errorf("could not kustomize: %w", err))
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// runHelm provides the values produced by CUE to helm template and returns
|
||||
// the rendered kubernetes api objects in the result.
|
||||
func (hc *HelmChart) helm(ctx context.Context, r *Result, path holos.InstancePath) error {
|
||||
log := logger.FromContext(ctx).With("chart", hc.Chart.Name)
|
||||
if hc.Chart.Name == "" {
|
||||
log.WarnContext(ctx, "skipping helm: no chart name specified, use a different component type")
|
||||
return nil
|
||||
}
|
||||
|
||||
cachedChartPath := filepath.Join(string(path), ChartDir, filepath.Base(hc.Chart.Name))
|
||||
if isNotExist(cachedChartPath) {
|
||||
// Add repositories
|
||||
repo := hc.Chart.Repository
|
||||
if repo.URL != "" {
|
||||
out, err := util.RunCmd(ctx, "helm", "repo", "add", repo.Name, repo.URL)
|
||||
if err != nil {
|
||||
log.ErrorContext(ctx, "could not run helm", "stderr", out.Stderr.String(), "stdout", out.Stdout.String())
|
||||
return errors.Wrap(fmt.Errorf("could not run helm repo add: %w", err))
|
||||
}
|
||||
// Update repository
|
||||
out, err = util.RunCmd(ctx, "helm", "repo", "update", repo.Name)
|
||||
if err != nil {
|
||||
log.ErrorContext(ctx, "could not run helm", "stderr", out.Stderr.String(), "stdout", out.Stdout.String())
|
||||
return errors.Wrap(fmt.Errorf("could not run helm repo update: %w", err))
|
||||
}
|
||||
} else {
|
||||
log.DebugContext(ctx, "no chart repository url proceeding assuming oci chart")
|
||||
}
|
||||
|
||||
// Cache the chart
|
||||
if err := cacheChart(ctx, path, ChartDir, hc.Chart); err != nil {
|
||||
return fmt.Errorf("could not cache chart: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Write values file
|
||||
tempDir, err := os.MkdirTemp("", "holos")
|
||||
if err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not make temp dir: %w", err))
|
||||
}
|
||||
defer util.Remove(ctx, tempDir)
|
||||
|
||||
valuesPath := filepath.Join(tempDir, "values.yaml")
|
||||
if err := os.WriteFile(valuesPath, []byte(hc.ValuesContent), 0644); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not write values: %w", err))
|
||||
}
|
||||
log.DebugContext(ctx, "helm: wrote values", "path", valuesPath, "bytes", len(hc.ValuesContent))
|
||||
|
||||
// Run charts
|
||||
chart := hc.Chart
|
||||
args := []string{"template"}
|
||||
if !hc.EnableHooks {
|
||||
args = append(args, "--no-hooks")
|
||||
}
|
||||
namespace := hc.Namespace
|
||||
args = append(args, "--include-crds", "--values", valuesPath, "--namespace", namespace, "--kubeconfig", "/dev/null", "--version", chart.Version, chart.Release, cachedChartPath)
|
||||
helmOut, err := util.RunCmd(ctx, "helm", args...)
|
||||
if err != nil {
|
||||
stderr := helmOut.Stderr.String()
|
||||
lines := strings.Split(stderr, "\n")
|
||||
for _, line := range lines {
|
||||
if strings.HasPrefix(line, "Error:") {
|
||||
err = fmt.Errorf("%s: %w", line, err)
|
||||
}
|
||||
}
|
||||
return errors.Wrap(fmt.Errorf("could not run helm template: %w", err))
|
||||
}
|
||||
|
||||
r.accumulatedOutput = helmOut.Stdout.String()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// cacheChart stores a cached copy of Chart in the chart subdirectory of path.
|
||||
func cacheChart(ctx context.Context, path holos.InstancePath, chartDir string, chart Chart) error {
|
||||
log := logger.FromContext(ctx)
|
||||
|
||||
cacheTemp, err := os.MkdirTemp(string(path), chartDir)
|
||||
if err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not make temp dir: %w", err))
|
||||
}
|
||||
defer util.Remove(ctx, cacheTemp)
|
||||
|
||||
chartName := chart.Name
|
||||
if chart.Repository.Name != "" {
|
||||
chartName = fmt.Sprintf("%s/%s", chart.Repository.Name, chart.Name)
|
||||
}
|
||||
helmOut, err := util.RunCmd(ctx, "helm", "pull", "--destination", cacheTemp, "--untar=true", "--version", chart.Version, chartName)
|
||||
if err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not run helm pull: %w", err))
|
||||
}
|
||||
log.Debug("helm pull", "stdout", helmOut.Stdout, "stderr", helmOut.Stderr)
|
||||
|
||||
cachePath := filepath.Join(string(path), chartDir)
|
||||
|
||||
if err := os.MkdirAll(cachePath, 0777); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not mkdir: %w", err))
|
||||
}
|
||||
|
||||
items, err := os.ReadDir(cacheTemp)
|
||||
if err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not read directory: %w", err))
|
||||
}
|
||||
|
||||
for _, item := range items {
|
||||
src := filepath.Join(cacheTemp, item.Name())
|
||||
dst := filepath.Join(cachePath, item.Name())
|
||||
log.DebugContext(ctx, "rename", "src", src, "dst", dst)
|
||||
if err := os.Rename(src, dst); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not rename: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
log.InfoContext(ctx, "cached", "chart", chart.Name, "version", chart.Version, "path", cachePath)
|
||||
|
||||
return nil
|
||||
}
|
||||
func isNotExist(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
return os.IsNotExist(err)
|
||||
}
|
||||
21
api/v1alpha1/kubernetesobjects.go
Normal file
21
api/v1alpha1/kubernetesobjects.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/holos-run/holos"
|
||||
)
|
||||
|
||||
const KubernetesObjectsKind = "KubernetesObjects"
|
||||
|
||||
// KubernetesObjects represents CUE output which directly provides Kubernetes api objects to holos.
|
||||
type KubernetesObjects struct {
|
||||
HolosComponent `json:",inline" yaml:",inline"`
|
||||
}
|
||||
|
||||
// Render produces kubernetes api objects from the APIObjectMap
|
||||
func (o *KubernetesObjects) Render(ctx context.Context, path holos.InstancePath) (*Result, error) {
|
||||
result := Result{HolosComponent: o.HolosComponent}
|
||||
result.addObjectMap(ctx, o.APIObjectMap)
|
||||
return &result, nil
|
||||
}
|
||||
7
api/v1alpha1/kustomization.go
Normal file
7
api/v1alpha1/kustomization.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package v1alpha1
|
||||
|
||||
// Kustomization holds the rendered flux kustomization api object content for git ops.
|
||||
type Kustomization struct {
|
||||
// KsContent is the yaml representation of the flux kustomization for gitops.
|
||||
KsContent string `json:"ksContent,omitempty" yaml:"ksContent,omitempty"`
|
||||
}
|
||||
47
api/v1alpha1/kustomize.go
Normal file
47
api/v1alpha1/kustomize.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/holos-run/holos"
|
||||
"github.com/holos-run/holos/internal/errors"
|
||||
"github.com/holos-run/holos/internal/logger"
|
||||
"github.com/holos-run/holos/internal/util"
|
||||
)
|
||||
|
||||
const KustomizeBuildKind = "KustomizeBuild"
|
||||
|
||||
// Kustomize represents resources necessary to execute a kustomize build.
|
||||
// Intended for at least two use cases:
|
||||
//
|
||||
// 1. Process raw yaml file resources in a holos component directory.
|
||||
// 2. Post process a HelmChart to inject istio, add custom labels, etc...
|
||||
type Kustomize struct {
|
||||
// KustomizeFiles holds file contents for kustomize, e.g. patch files.
|
||||
KustomizeFiles FileContentMap `json:"kustomizeFiles,omitempty" yaml:"kustomizeFiles,omitempty"`
|
||||
// ResourcesFile is the file name used for api objects in kustomization.yaml
|
||||
ResourcesFile string `json:"resourcesFile,omitempty" yaml:"resourcesFile,omitempty"`
|
||||
}
|
||||
|
||||
// KustomizeBuild renders plain yaml files in the holos component directory using kubectl kustomize build.
|
||||
type KustomizeBuild struct {
|
||||
HolosComponent `json:",inline" yaml:",inline"`
|
||||
}
|
||||
|
||||
// Render produces a Result by executing kubectl kustomize on the holos
|
||||
// component path. Useful for processing raw yaml files.
|
||||
func (kb *KustomizeBuild) Render(ctx context.Context, path holos.InstancePath) (*Result, error) {
|
||||
log := logger.FromContext(ctx)
|
||||
result := Result{HolosComponent: kb.HolosComponent}
|
||||
// Run kustomize.
|
||||
kOut, err := util.RunCmd(ctx, "kubectl", "kustomize", string(path))
|
||||
if err != nil {
|
||||
log.ErrorContext(ctx, kOut.Stderr.String())
|
||||
return nil, errors.Wrap(err)
|
||||
}
|
||||
// Replace the accumulated output
|
||||
result.accumulatedOutput = kOut.Stdout.String()
|
||||
// Add CUE based api objects.
|
||||
result.addObjectMap(ctx, kb.APIObjectMap)
|
||||
return &result, nil
|
||||
}
|
||||
14
api/v1alpha1/objectmap.go
Normal file
14
api/v1alpha1/objectmap.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package v1alpha1
|
||||
|
||||
// Label is an arbitrary unique identifier. Defined as a type for clarity and type checking.
|
||||
type Label string
|
||||
|
||||
// Kind is a kubernetes api object kind. Defined as a type for clarity and type checking.
|
||||
type Kind string
|
||||
|
||||
// APIObjectMap is the shape of marshalled api objects returned from cue to the
|
||||
// holos cli. A map is used to improve the clarity of error messages from cue.
|
||||
type APIObjectMap map[Kind]map[Label]string
|
||||
|
||||
// FileContentMap is a map of file names to file contents.
|
||||
type FileContentMap map[string]string
|
||||
15
api/v1alpha1/objectmeta.go
Normal file
15
api/v1alpha1/objectmeta.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package v1alpha1
|
||||
|
||||
// ObjectMeta represents metadata of a holos component object. The fields are a
|
||||
// copy of upstream kubernetes api machinery but are by holos objects distinct
|
||||
// from kubernetes api objects.
|
||||
type ObjectMeta struct {
|
||||
// Name uniquely identifies the holos component instance and must be suitable as a file name.
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
// Namespace confines a holos component to a single namespace via kustomize if set.
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
// Labels are not used but are copied from api machinery ObjectMeta for completeness.
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
// Annotations are not used but are copied from api machinery ObjectMeta for completeness.
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
}
|
||||
22
api/v1alpha1/render.go
Normal file
22
api/v1alpha1/render.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/holos-run/holos"
|
||||
)
|
||||
|
||||
type Renderer interface {
|
||||
GetKind() string
|
||||
Render(ctx context.Context, path holos.InstancePath) (*Result, error)
|
||||
}
|
||||
|
||||
// Render produces a Result representing the kubernetes api objects to
|
||||
// configure. Each of the various holos component types, e.g. Helm, Kustomize,
|
||||
// et al, should implement the Renderer interface. This process is best
|
||||
// conceptualized as a data pipeline, for example a component may render a
|
||||
// result by first calling helm template, then passing the result through
|
||||
// kustomize, then mixing in overlay api objects.
|
||||
func Render(ctx context.Context, r Renderer, path holos.InstancePath) (*Result, error) {
|
||||
return r.Render(ctx, path)
|
||||
}
|
||||
138
api/v1alpha1/result.go
Normal file
138
api/v1alpha1/result.go
Normal file
@@ -0,0 +1,138 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
||||
"github.com/holos-run/holos/internal/errors"
|
||||
"github.com/holos-run/holos/internal/logger"
|
||||
"github.com/holos-run/holos/internal/util"
|
||||
)
|
||||
|
||||
// Result is the build result for display or writing. Holos components Render the Result as a data pipeline.
|
||||
type Result struct {
|
||||
HolosComponent
|
||||
// accumulatedOutput accumulates rendered api objects.
|
||||
accumulatedOutput string
|
||||
}
|
||||
|
||||
func (r *Result) Name() string {
|
||||
return r.Metadata.Name
|
||||
}
|
||||
|
||||
func (r *Result) Filename(writeTo string, cluster string) string {
|
||||
name := r.Metadata.Name
|
||||
return filepath.Join(writeTo, "clusters", cluster, "components", name, name+".gen.yaml")
|
||||
}
|
||||
|
||||
func (r *Result) KustomizationFilename(writeTo string, cluster string) string {
|
||||
return filepath.Join(writeTo, "clusters", cluster, "holos", "components", r.Metadata.Name+"-kustomization.gen.yaml")
|
||||
}
|
||||
|
||||
// AccumulatedOutput returns the accumulated rendered output.
|
||||
func (r *Result) AccumulatedOutput() string {
|
||||
return r.accumulatedOutput
|
||||
}
|
||||
|
||||
// addObjectMap renders the provided APIObjectMap into the accumulated output.
|
||||
func (r *Result) addObjectMap(ctx context.Context, objectMap APIObjectMap) {
|
||||
log := logger.FromContext(ctx)
|
||||
b := []byte(r.AccumulatedOutput())
|
||||
kinds := make([]Kind, 0, len(objectMap))
|
||||
// Sort the keys
|
||||
for kind := range objectMap {
|
||||
kinds = append(kinds, kind)
|
||||
}
|
||||
slices.Sort(kinds)
|
||||
|
||||
for _, kind := range kinds {
|
||||
v := objectMap[kind]
|
||||
// Sort the keys
|
||||
names := make([]Label, 0, len(v))
|
||||
for name := range v {
|
||||
names = append(names, name)
|
||||
}
|
||||
slices.Sort(names)
|
||||
|
||||
for _, name := range names {
|
||||
yamlString := v[name]
|
||||
log.Debug(fmt.Sprintf("%s/%s", kind, name), "kind", kind, "name", name)
|
||||
b = util.EnsureNewline(b)
|
||||
header := fmt.Sprintf("---\n# Source: CUE apiObjects.%s.%s\n", kind, name)
|
||||
b = append(b, []byte(header+yamlString)...)
|
||||
b = util.EnsureNewline(b)
|
||||
}
|
||||
}
|
||||
r.accumulatedOutput = string(b)
|
||||
}
|
||||
|
||||
// kustomize replaces the accumulated output with the output of kustomize build
|
||||
func (r *Result) kustomize(ctx context.Context) error {
|
||||
log := logger.FromContext(ctx)
|
||||
if r.ResourcesFile == "" {
|
||||
log.DebugContext(ctx, "skipping kustomize: no resourcesFile")
|
||||
return nil
|
||||
}
|
||||
if len(r.KustomizeFiles) < 1 {
|
||||
log.DebugContext(ctx, "skipping kustomize: no kustomizeFiles")
|
||||
return nil
|
||||
}
|
||||
tempDir, err := os.MkdirTemp("", "holos.kustomize")
|
||||
if err != nil {
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
defer util.Remove(ctx, tempDir)
|
||||
|
||||
// Write the main api object resources file for kustomize.
|
||||
target := filepath.Join(tempDir, r.ResourcesFile)
|
||||
b := []byte(r.AccumulatedOutput())
|
||||
b = util.EnsureNewline(b)
|
||||
if err := os.WriteFile(target, b, 0644); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not write resources: %w", err))
|
||||
}
|
||||
log.DebugContext(ctx, "wrote: "+target, "op", "write", "path", target, "bytes", len(b))
|
||||
|
||||
// Write the kustomization tree, kustomization.yaml must be in this map for kustomize to work.
|
||||
for file, content := range r.KustomizeFiles {
|
||||
target := filepath.Join(tempDir, file)
|
||||
if err := os.MkdirAll(filepath.Dir(target), 0755); err != nil {
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
b := []byte(content)
|
||||
b = util.EnsureNewline(b)
|
||||
if err := os.WriteFile(target, b, 0644); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not write: %w", err))
|
||||
}
|
||||
log.DebugContext(ctx, "wrote: "+target, "op", "write", "path", target, "bytes", len(b))
|
||||
}
|
||||
|
||||
// Run kustomize.
|
||||
kOut, err := util.RunCmd(ctx, "kubectl", "kustomize", tempDir)
|
||||
if err != nil {
|
||||
log.ErrorContext(ctx, kOut.Stderr.String())
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
// Replace the accumulated output
|
||||
r.accumulatedOutput = kOut.Stdout.String()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Save writes the content to the filesystem for git ops.
|
||||
func (r *Result) Save(ctx context.Context, path string, content string) error {
|
||||
log := logger.FromContext(ctx)
|
||||
dir := filepath.Dir(path)
|
||||
if err := os.MkdirAll(dir, os.FileMode(0775)); err != nil {
|
||||
log.WarnContext(ctx, "could not mkdir", "path", dir, "err", err)
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
// Write the kube api objects
|
||||
if err := os.WriteFile(path, []byte(content), os.FileMode(0644)); err != nil {
|
||||
log.WarnContext(ctx, "could not write", "path", path, "err", err)
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
log.DebugContext(ctx, "out: wrote "+path, "action", "write", "path", path, "status", "ok")
|
||||
return nil
|
||||
}
|
||||
10
api/v1alpha1/typemeta.go
Normal file
10
api/v1alpha1/typemeta.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package v1alpha1
|
||||
|
||||
type TypeMeta struct {
|
||||
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
|
||||
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
|
||||
}
|
||||
|
||||
func (tm *TypeMeta) GetKind() string {
|
||||
return tm.Kind
|
||||
}
|
||||
24
buf.gen.yaml
Normal file
24
buf.gen.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Generates gRPC and ConnectRPC bindings for Go and TypeScript
|
||||
#
|
||||
# Note: protoc-gen-connect-query is the primary method of wiring up the React
|
||||
# frontend.
|
||||
version: v1
|
||||
plugins:
|
||||
- plugin: go
|
||||
out: service/gen
|
||||
opt: paths=source_relative
|
||||
- plugin: connect-go
|
||||
out: service/gen
|
||||
opt: paths=source_relative
|
||||
- plugin: es
|
||||
out: internal/frontend/holos/src/app/gen
|
||||
opt:
|
||||
- target=ts
|
||||
- plugin: connect-es
|
||||
out: internal/frontend/holos/src/app/gen
|
||||
opt:
|
||||
- target=ts
|
||||
- plugin: connect-query
|
||||
out: internal/frontend/holos/src/app/gen
|
||||
opt:
|
||||
- target=ts
|
||||
8
buf.lock
Normal file
8
buf.lock
Normal file
@@ -0,0 +1,8 @@
|
||||
# Generated by buf. DO NOT EDIT.
|
||||
version: v1
|
||||
deps:
|
||||
- remote: buf.build
|
||||
owner: bufbuild
|
||||
repository: protovalidate
|
||||
commit: b983156c5e994cc9892e0ce3e64e17e0
|
||||
digest: shake256:fb47a62989d38c2529bcc5cd86ded43d800eb84cee82b42b9e8a9e815d4ee8134a0fb9d0ce8299b27c2d2bbb7d6ade0c4ad5a8a4d467e1e2c7ca619ae9f634e2
|
||||
3
buf.work.yaml
Normal file
3
buf.work.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
version: v1
|
||||
directories:
|
||||
- service
|
||||
@@ -1,28 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/holos-run/holos/pkg/cli"
|
||||
"github.com/holos-run/holos/pkg/config"
|
||||
"github.com/holos-run/holos/pkg/wrapper"
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/holos-run/holos/internal/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cfg := config.New()
|
||||
slog.SetDefault(cfg.Logger())
|
||||
ctx := context.Background()
|
||||
if err := cli.New(cfg).ExecuteContext(ctx); err != nil {
|
||||
log := cfg.NewTopLevelLogger()
|
||||
var errAt *wrapper.ErrorAt
|
||||
const msg = "could not execute"
|
||||
if ok := errors.As(err, &errAt); ok {
|
||||
log.ErrorContext(ctx, msg, "err", errAt.Unwrap(), "loc", errAt.Source.Loc())
|
||||
} else {
|
||||
log.ErrorContext(ctx, msg, "err", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(cli.MakeMain()())
|
||||
}
|
||||
|
||||
21
cmd/holos/main_test.go
Normal file
21
cmd/holos/main_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/holos-run/holos/internal/cli"
|
||||
"github.com/rogpeppe/go-internal/testscript"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
os.Exit(testscript.RunMain(m, map[string]func() int{
|
||||
"holos": cli.MakeMain(),
|
||||
}))
|
||||
}
|
||||
|
||||
func TestGetSecrets(t *testing.T) {
|
||||
testscript.Run(t, testscript.Params{
|
||||
Dir: "testdata",
|
||||
})
|
||||
}
|
||||
31
cmd/holos/testdata/constraints.txt
vendored
Normal file
31
cmd/holos/testdata/constraints.txt
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# Want support for intermediary constraints
|
||||
exec holos build ./foo/... --log-level debug
|
||||
stdout '^bf2bc7f9-9ba0-4f9e-9bd2-9a205627eb0b$'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- foo/constraints.cue --
|
||||
package holos
|
||||
|
||||
metadata: name: "jeff"
|
||||
-- foo/bar/bar.cue --
|
||||
package holos
|
||||
|
||||
spec: components: KubernetesObjectsList: [
|
||||
#KubernetesObjects & {
|
||||
apiObjectMap: foo: bar: "bf2bc7f9-9ba0-4f9e-9bd2-9a205627eb0b"
|
||||
}
|
||||
]
|
||||
-- schema.cue --
|
||||
package holos
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
#KubernetesObjects: {
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "KubernetesObjects"
|
||||
apiObjectMap: {...}
|
||||
}
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
17
cmd/holos/testdata/issue15_cue_errors.txt
vendored
Normal file
17
cmd/holos/testdata/issue15_cue_errors.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Want cue errors to show files and lines
|
||||
! exec holos build .
|
||||
stderr 'apiObjectMap.foo.bar: cannot convert incomplete value'
|
||||
stderr '/component.cue:\d+:\d+$'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: KubernetesObjectsList: [{apiObjectMap: foo: bar: _baz}]
|
||||
|
||||
_baz: string
|
||||
58
cmd/holos/testdata/issue25_apiobjects_cue.txt
vendored
Normal file
58
cmd/holos/testdata/issue25_apiobjects_cue.txt
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Want kube api objects in the apiObjects output.
|
||||
exec holos build .
|
||||
stdout '^kind: SecretStore$'
|
||||
stdout '# Source: CUE apiObjects.SecretStore.default'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: KubernetesObjectsList: [{apiObjectMap: #APIObjects.apiObjectMap}]
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
#SecretStore: {
|
||||
kind: string
|
||||
metadata: name: string
|
||||
}
|
||||
|
||||
#APIObjects: {
|
||||
apiObjects: {
|
||||
SecretStore: {
|
||||
default: #SecretStore & { metadata: name: "default" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- schema.cue --
|
||||
package holos
|
||||
|
||||
// #APIObjects is the output type for api objects produced by cue. A map is used to aid debugging and clarity.
|
||||
import "encoding/yaml"
|
||||
|
||||
#APIObjects: {
|
||||
// apiObjects holds each the api objects produced by cue.
|
||||
apiObjects: {
|
||||
[Kind=_]: {
|
||||
[Name=_]: {
|
||||
kind: Kind
|
||||
metadata: name: Name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// apiObjectsContent holds the marshalled representation of apiObjects
|
||||
apiObjectMap: {
|
||||
for kind, v in apiObjects {
|
||||
"\(kind)": {
|
||||
for name, obj in v {
|
||||
"\(name)": yaml.Marshal(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
cmd/holos/testdata/issue25_apiobjects_helm.txt
vendored
Normal file
59
cmd/holos/testdata/issue25_apiobjects_helm.txt
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# Want kube api objects in the apiObjects output.
|
||||
exec holos build .
|
||||
stdout '^kind: SecretStore$'
|
||||
stdout '# Source: CUE apiObjects.SecretStore.default'
|
||||
stderr 'skipping helm: no chart name specified'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: HelmChartList: [{apiObjectMap: #APIObjects.apiObjectMap}]
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
#SecretStore: {
|
||||
kind: string
|
||||
metadata: name: string
|
||||
}
|
||||
|
||||
#APIObjects: {
|
||||
apiObjects: {
|
||||
SecretStore: {
|
||||
default: #SecretStore & { metadata: name: "default" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- schema.cue --
|
||||
package holos
|
||||
|
||||
// #APIObjects is the output type for api objects produced by cue. A map is used to aid debugging and clarity.
|
||||
import "encoding/yaml"
|
||||
|
||||
#APIObjects: {
|
||||
// apiObjects holds each the api objects produced by cue.
|
||||
apiObjects: {
|
||||
[Kind=_]: {
|
||||
[Name=_]: {
|
||||
kind: Kind
|
||||
metadata: name: Name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// apiObjectsContent holds the marshalled representation of apiObjects
|
||||
apiObjectMap: {
|
||||
for kind, v in apiObjects {
|
||||
"\(kind)": {
|
||||
for name, obj in v {
|
||||
"\(name)": yaml.Marshal(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
22
cmd/holos/testdata/issue25_show_object_names.txt
vendored
Normal file
22
cmd/holos/testdata/issue25_show_object_names.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Want api object kind and name in errors
|
||||
! exec holos build .
|
||||
stderr 'apiObjects.secretstore.default.foo: field not allowed'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "KubernetesObjects"
|
||||
cluster: string @tag(cluster, string)
|
||||
|
||||
#SecretStore: {
|
||||
metadata: name: string
|
||||
}
|
||||
|
||||
apiObjects: {
|
||||
secretstore: {
|
||||
default: #SecretStore & { foo: "not allowed" }
|
||||
}
|
||||
}
|
||||
286
cmd/holos/testdata/issue33_helm_stderr.txt
vendored
Normal file
286
cmd/holos/testdata/issue33_helm_stderr.txt
vendored
Normal file
@@ -0,0 +1,286 @@
|
||||
# Want helm errors to show up
|
||||
! exec holos build .
|
||||
stderr 'Error: execution error at \(zitadel/templates/secret_zitadel-masterkey.yaml:2:4\): Either set .Values.zitadel.masterkey xor .Values.zitadel.masterkeySecretName'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- zitadel.cue --
|
||||
package holos
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: HelmChartList: [_HelmChart]
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
_HelmChart: {
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "HelmChart"
|
||||
metadata: name: "zitadel"
|
||||
namespace: "zitadel"
|
||||
chart: {
|
||||
name: "zitadel"
|
||||
version: "7.9.0"
|
||||
release: name
|
||||
repository: {
|
||||
name: "zitadel"
|
||||
url: "https://charts.zitadel.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- vendor/zitadel/templates/secret_zitadel-masterkey.yaml --
|
||||
{{- if (or (and .Values.zitadel.masterkey .Values.zitadel.masterkeySecretName) (and (not .Values.zitadel.masterkey) (not .Values.zitadel.masterkeySecretName)) ) }}
|
||||
{{- fail "Either set .Values.zitadel.masterkey xor .Values.zitadel.masterkeySecretName" }}
|
||||
{{- end }}
|
||||
{{- if .Values.zitadel.masterkey -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: Opaque
|
||||
metadata:
|
||||
name: zitadel-masterkey
|
||||
{{- with .Values.zitadel.masterkeyAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "zitadel.labels" . | nindent 4 }}
|
||||
stringData:
|
||||
masterkey: {{ .Values.zitadel.masterkey }}
|
||||
{{- end -}}
|
||||
-- vendor/zitadel/Chart.yaml --
|
||||
apiVersion: v2
|
||||
appVersion: v2.46.0
|
||||
description: A Helm chart for ZITADEL
|
||||
icon: https://zitadel.com/zitadel-logo-dark.svg
|
||||
kubeVersion: '>= 1.21.0-0'
|
||||
maintainers:
|
||||
- email: support@zitadel.com
|
||||
name: zitadel
|
||||
url: https://zitadel.com
|
||||
name: zitadel
|
||||
type: application
|
||||
version: 7.9.0
|
||||
-- vendor/zitadel/values.yaml --
|
||||
# Default values for zitadel.
|
||||
zitadel:
|
||||
# The ZITADEL config under configmapConfig is written to a Kubernetes ConfigMap
|
||||
# See all defaults here:
|
||||
# https://github.com/zitadel/zitadel/blob/main/cmd/defaults.yaml
|
||||
configmapConfig:
|
||||
ExternalSecure: true
|
||||
Machine:
|
||||
Identification:
|
||||
Hostname:
|
||||
Enabled: true
|
||||
Webhook:
|
||||
Enabled: false
|
||||
|
||||
# The ZITADEL config under secretConfig is written to a Kubernetes Secret
|
||||
# See all defaults here:
|
||||
# https://github.com/zitadel/zitadel/blob/main/cmd/defaults.yaml
|
||||
secretConfig:
|
||||
|
||||
# Annotations set on secretConfig secret
|
||||
secretConfigAnnotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "0"
|
||||
|
||||
# Reference the name of a secret that contains ZITADEL configuration.
|
||||
configSecretName:
|
||||
# The key under which the ZITADEL configuration is located in the secret.
|
||||
configSecretKey: config-yaml
|
||||
|
||||
# ZITADEL uses the masterkey for symmetric encryption.
|
||||
# You can generate it for example with tr -dc A-Za-z0-9 </dev/urandom | head -c 32
|
||||
masterkey: ""
|
||||
# Reference the name of the secret that contains the masterkey. The key should be named "masterkey".
|
||||
# Note: Either zitadel.masterkey or zitadel.masterkeySecretName must be set
|
||||
masterkeySecretName: ""
|
||||
|
||||
# Annotations set on masterkey secret
|
||||
masterkeyAnnotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "0"
|
||||
|
||||
# The CA Certificate needed for establishing secure database connections
|
||||
dbSslCaCrt: ""
|
||||
|
||||
# The Secret containing the CA certificate at key ca.crt needed for establishing secure database connections
|
||||
dbSslCaCrtSecret: ""
|
||||
|
||||
# The db admins secret containing the client certificate and key at tls.crt and tls.key needed for establishing secure database connections
|
||||
dbSslAdminCrtSecret: ""
|
||||
|
||||
# The db users secret containing the client certificate and key at tls.crt and tls.key needed for establishing secure database connections
|
||||
dbSslUserCrtSecret: ""
|
||||
|
||||
# Generate a self-signed certificate using an init container
|
||||
# This will also mount the generated files to /etc/tls/ so that you can reference them in the pod.
|
||||
# E.G. KeyPath: /etc/tls/tls.key CertPath: /etc/tls/tls.crt
|
||||
# By default, the SAN DNS names include, localhost, the POD IP address and the POD name. You may include one more by using additionalDnsName like "my.zitadel.fqdn".
|
||||
selfSignedCert:
|
||||
enabled: false
|
||||
additionalDnsName:
|
||||
|
||||
replicaCount: 3
|
||||
|
||||
image:
|
||||
repository: ghcr.io/zitadel/zitadel
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
chownImage:
|
||||
repository: alpine
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "3.19"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
# Annotations to add to the deployment
|
||||
annotations: {}
|
||||
|
||||
# Annotations to add to the configMap
|
||||
configMap:
|
||||
annotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "0"
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "0"
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podAdditionalLabels: {}
|
||||
|
||||
podSecurityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
|
||||
securityContext: {}
|
||||
|
||||
# Additional environment variables
|
||||
env:
|
||||
[]
|
||||
# - name: ZITADEL_DATABASE_POSTGRES_HOST
|
||||
# valueFrom:
|
||||
# secretKeyRef:
|
||||
# name: postgres-pguser-postgres
|
||||
# key: host
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
# If service type is "ClusterIP", this can optionally be set to a fixed IP address.
|
||||
clusterIP: ""
|
||||
port: 8080
|
||||
protocol: http2
|
||||
annotations: {}
|
||||
scheme: HTTP
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
hosts:
|
||||
- host: localhost
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
topologySpreadConstraints: []
|
||||
|
||||
initJob:
|
||||
# Once ZITADEL is installed, the initJob can be disabled.
|
||||
enabled: true
|
||||
annotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "1"
|
||||
resources: {}
|
||||
backoffLimit: 5
|
||||
activeDeadlineSeconds: 300
|
||||
extraContainers: []
|
||||
podAnnotations: {}
|
||||
# Available init commands :
|
||||
# "": initialize ZITADEL instance (without skip anything)
|
||||
# database: initialize only the database
|
||||
# grant: set ALL grant to user
|
||||
# user: initialize only the database user
|
||||
# zitadel: initialize ZITADEL internals (skip "create user" and "create database")
|
||||
command: ""
|
||||
|
||||
setupJob:
|
||||
annotations:
|
||||
helm.sh/hook: pre-install,pre-upgrade
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
helm.sh/hook-weight: "2"
|
||||
resources: {}
|
||||
activeDeadlineSeconds: 300
|
||||
extraContainers: []
|
||||
podAnnotations: {}
|
||||
additionalArgs:
|
||||
- "--init-projections=true"
|
||||
machinekeyWriter:
|
||||
image:
|
||||
repository: bitnami/kubectl
|
||||
tag: ""
|
||||
resources: {}
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
startupProbe:
|
||||
enabled: true
|
||||
periodSeconds: 1
|
||||
failureThreshold: 30
|
||||
|
||||
metrics:
|
||||
enabled: false
|
||||
serviceMonitor:
|
||||
# If true, the chart creates a ServiceMonitor that is compatible with Prometheus Operator
|
||||
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitor.
|
||||
# The Prometheus community Helm chart installs this operator
|
||||
# https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#kube-prometheus-stack
|
||||
enabled: false
|
||||
honorLabels: false
|
||||
honorTimestamps: true
|
||||
|
||||
pdb:
|
||||
enabled: false
|
||||
# these values are used for the PDB and are mutally exclusive
|
||||
minAvailable: 1
|
||||
# maxUnavailable: 1
|
||||
annotations: {}
|
||||
36
cmd/holos/testdata/issue42_kustomize_build_kind.txt
vendored
Normal file
36
cmd/holos/testdata/issue42_kustomize_build_kind.txt
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Kustomize is a supported holos component kind
|
||||
exec holos render --cluster-name=mycluster . --log-level=debug
|
||||
|
||||
# Want generated output
|
||||
cmp want.yaml deploy/clusters/mycluster/components/kstest/kstest.gen.yaml
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: KustomizeBuildList: [{metadata: name: "kstest"}]
|
||||
|
||||
-- kustomization.yaml --
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: mynamespace
|
||||
resources:
|
||||
- serviceaccount.yaml
|
||||
|
||||
-- serviceaccount.yaml --
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: test
|
||||
|
||||
-- want.yaml --
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: test
|
||||
namespace: mynamespace
|
||||
14
cmd/holos/testdata/issue72_disallow_unknown_fields.txt
vendored
Normal file
14
cmd/holos/testdata/issue72_disallow_unknown_fields.txt
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# https://github.com/holos-run/holos/issues/72
|
||||
# Want holos to fail on unknown fields to catch typos and aid refactors
|
||||
! exec holos build .
|
||||
stderr 'unknown field \\"TypoKubernetesObjectsList\\"'
|
||||
|
||||
-- cue.mod --
|
||||
package holos
|
||||
-- component.cue --
|
||||
package holos
|
||||
_cluster: string @tag(cluster, string)
|
||||
|
||||
apiVersion: "holos.run/v1alpha1"
|
||||
kind: "BuildPlan"
|
||||
spec: components: TypoKubernetesObjectsList: []
|
||||
5
cmd/holos/testdata/version.txt
vendored
Normal file
5
cmd/holos/testdata/version.txt
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
exec holos --version
|
||||
# want version with no v on stdout
|
||||
stdout -count=1 '^\d+\.\d+\.\d+$'
|
||||
# want nothing on stderr
|
||||
! stderr .
|
||||
45
docs/examples/authpolicy.cue
Normal file
45
docs/examples/authpolicy.cue
Normal file
@@ -0,0 +1,45 @@
|
||||
package holos
|
||||
|
||||
import ap "security.istio.io/authorizationpolicy/v1"
|
||||
|
||||
// #AuthPolicyRules represents AuthorizationPolicy rules for hosts that need
|
||||
// specialized treatment. Entries in this struct are excluded from
|
||||
// AuthorizationPolicy/authproxy-custom in the istio-ingress namespace. Entries
|
||||
// are added to their own AuthorizationPolicy.
|
||||
#AuthPolicyRules: {
|
||||
// AuthProxySpec represents the identity provider configuration
|
||||
AuthProxySpec: #AuthProxySpec & #Platform.authproxy
|
||||
|
||||
// Hosts are hosts that need specialized treatment
|
||||
hosts: {
|
||||
[Name=_]: {
|
||||
// name is the fully qualifed hostname, a Host: header value.
|
||||
name: Name
|
||||
// slug is the resource name prefix
|
||||
slug: string
|
||||
// NoAuthorizationPolicy disables an AuthorizationPolicy for the host
|
||||
NoAuthorizationPolicy: true | *false
|
||||
|
||||
// Refer to https://istio.io/latest/docs/reference/config/security/authorization-policy/#Rule
|
||||
spec: ap.#AuthorizationPolicySpec & {
|
||||
action: "CUSTOM"
|
||||
provider: name: AuthProxySpec.provider
|
||||
selector: matchLabels: istio: "ingressgateway"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
objects: #APIObjects & {
|
||||
for Host in hosts {
|
||||
if Host.NoAuthorizationPolicy == false {
|
||||
apiObjects: {
|
||||
AuthorizationPolicy: "\(Host.slug)-custom": {
|
||||
metadata: namespace: "istio-ingress"
|
||||
metadata: name: "\(Host.slug)-custom"
|
||||
spec: Host.spec
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-mesh-certmanager/prod-mesh-certmanager.gen.yaml
|
||||
|
||||
package v1
|
||||
|
||||
import "strings"
|
||||
|
||||
// Order is a type to represent an Order with an ACME server
|
||||
#Order: {
|
||||
// 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
|
||||
apiVersion: "acme.cert-manager.io/v1"
|
||||
|
||||
// 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
|
||||
kind: "Order"
|
||||
metadata: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
spec!: #OrderSpec
|
||||
}
|
||||
#OrderSpec: {
|
||||
// CommonName is the common name as specified on the DER encoded
|
||||
// CSR. If specified, this value must also be present in
|
||||
// `dnsNames` or `ipAddresses`. This field must match the
|
||||
// corresponding field on the DER encoded CSR.
|
||||
commonName?: string
|
||||
|
||||
// DNSNames is a list of DNS names that should be included as part
|
||||
// of the Order validation process. This field must match the
|
||||
// corresponding field on the DER encoded CSR.
|
||||
dnsNames?: [...string]
|
||||
|
||||
// Duration is the duration for the not after date for the
|
||||
// requested certificate. this is set on order creation as pe the
|
||||
// ACME spec.
|
||||
duration?: string
|
||||
|
||||
// IPAddresses is a list of IP addresses that should be included
|
||||
// as part of the Order validation process. This field must match
|
||||
// the corresponding field on the DER encoded CSR.
|
||||
ipAddresses?: [...string]
|
||||
|
||||
// IssuerRef references a properly configured ACME-type Issuer
|
||||
// which should be used to create this Order. If the Issuer does
|
||||
// not exist, processing will be retried. If the Issuer is not an
|
||||
// 'ACME' Issuer, an error will be returned and the Order will be
|
||||
// marked as failed.
|
||||
issuerRef: {
|
||||
// Group of the resource being referred to.
|
||||
group?: string
|
||||
|
||||
// Kind of the resource being referred to.
|
||||
kind?: string
|
||||
|
||||
// Name of the resource being referred to.
|
||||
name: string
|
||||
}
|
||||
|
||||
// Certificate signing request bytes in DER encoding. This will be
|
||||
// used when finalizing the order. This field must be set on the
|
||||
// order.
|
||||
request: string
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,189 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-platform-argocd/prod-platform-argocd.gen.yaml
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import "strings"
|
||||
|
||||
// AppProject provides a logical grouping of applications,
|
||||
// providing controls for: * where the apps may deploy to
|
||||
// (cluster whitelist) * what may be deployed (repository
|
||||
// whitelist, resource whitelist/blacklist) * who can access
|
||||
// these applications (roles, OIDC group claims bindings) * and
|
||||
// what they can do (RBAC policies) * automation access to these
|
||||
// roles (JWT tokens)
|
||||
#AppProject: {
|
||||
// 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
|
||||
apiVersion: "argoproj.io/v1alpha1"
|
||||
|
||||
// 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
|
||||
kind: "AppProject"
|
||||
metadata: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
|
||||
// AppProjectSpec is the specification of an AppProject
|
||||
spec!: #AppProjectSpec
|
||||
}
|
||||
|
||||
// AppProjectSpec is the specification of an AppProject
|
||||
#AppProjectSpec: {
|
||||
// ClusterResourceBlacklist contains list of blacklisted cluster
|
||||
// level resources
|
||||
clusterResourceBlacklist?: [...{
|
||||
group: string
|
||||
kind: string
|
||||
}]
|
||||
|
||||
// ClusterResourceWhitelist contains list of whitelisted cluster
|
||||
// level resources
|
||||
clusterResourceWhitelist?: [...{
|
||||
group: string
|
||||
kind: string
|
||||
}]
|
||||
|
||||
// Description contains optional project description
|
||||
description?: string
|
||||
|
||||
// Destinations contains list of destinations available for
|
||||
// deployment
|
||||
destinations?: [...{
|
||||
// Name is an alternate way of specifying the target cluster by
|
||||
// its symbolic name. This must be set if Server is not set.
|
||||
name?: string
|
||||
|
||||
// Namespace specifies the target namespace for the application's
|
||||
// resources. The namespace will only be set for namespace-scoped
|
||||
// resources that have not set a value for .metadata.namespace
|
||||
namespace?: string
|
||||
|
||||
// Server specifies the URL of the target cluster's Kubernetes
|
||||
// control plane API. This must be set if Name is not set.
|
||||
server?: string
|
||||
}]
|
||||
|
||||
// NamespaceResourceBlacklist contains list of blacklisted
|
||||
// namespace level resources
|
||||
namespaceResourceBlacklist?: [...{
|
||||
group: string
|
||||
kind: string
|
||||
}]
|
||||
|
||||
// NamespaceResourceWhitelist contains list of whitelisted
|
||||
// namespace level resources
|
||||
namespaceResourceWhitelist?: [...{
|
||||
group: string
|
||||
kind: string
|
||||
}]
|
||||
|
||||
// OrphanedResources specifies if controller should monitor
|
||||
// orphaned resources of apps in this project
|
||||
orphanedResources?: {
|
||||
// Ignore contains a list of resources that are to be excluded
|
||||
// from orphaned resources monitoring
|
||||
ignore?: [...{
|
||||
group?: string
|
||||
kind?: string
|
||||
name?: string
|
||||
}]
|
||||
|
||||
// Warn indicates if warning condition should be created for apps
|
||||
// which have orphaned resources
|
||||
warn?: bool
|
||||
}
|
||||
|
||||
// PermitOnlyProjectScopedClusters determines whether destinations
|
||||
// can only reference clusters which are project-scoped
|
||||
permitOnlyProjectScopedClusters?: bool
|
||||
|
||||
// Roles are user defined RBAC roles associated with this project
|
||||
roles?: [...{
|
||||
// Description is a description of the role
|
||||
description?: string
|
||||
|
||||
// Groups are a list of OIDC group claims bound to this role
|
||||
groups?: [...string]
|
||||
|
||||
// JWTTokens are a list of generated JWT tokens bound to this role
|
||||
jwtTokens?: [...{
|
||||
exp?: int
|
||||
iat: int
|
||||
id?: string
|
||||
}]
|
||||
|
||||
// Name is a name for this role
|
||||
name: string
|
||||
|
||||
// Policies Stores a list of casbin formatted strings that define
|
||||
// access policies for the role in the project
|
||||
policies?: [...string]
|
||||
}]
|
||||
|
||||
// SignatureKeys contains a list of PGP key IDs that commits in
|
||||
// Git must be signed with in order to be allowed for sync
|
||||
signatureKeys?: [...{
|
||||
// The ID of the key in hexadecimal notation
|
||||
keyID: string
|
||||
}]
|
||||
|
||||
// SourceNamespaces defines the namespaces application resources
|
||||
// are allowed to be created in
|
||||
sourceNamespaces?: [...string]
|
||||
|
||||
// SourceRepos contains list of repository URLs which can be used
|
||||
// for deployment
|
||||
sourceRepos?: [...string]
|
||||
|
||||
// SyncWindows controls when syncs can be run for apps in this
|
||||
// project
|
||||
syncWindows?: [...{
|
||||
// Applications contains a list of applications that the window
|
||||
// will apply to
|
||||
applications?: [...string]
|
||||
|
||||
// Clusters contains a list of clusters that the window will apply
|
||||
// to
|
||||
clusters?: [...string]
|
||||
|
||||
// Duration is the amount of time the sync window will be open
|
||||
duration?: string
|
||||
|
||||
// Kind defines if the window allows or blocks syncs
|
||||
kind?: string
|
||||
|
||||
// ManualSync enables manual syncs when they would otherwise be
|
||||
// blocked
|
||||
manualSync?: bool
|
||||
|
||||
// Namespaces contains a list of namespaces that the window will
|
||||
// apply to
|
||||
namespaces?: [...string]
|
||||
|
||||
// Schedule is the time the window will begin, specified in cron
|
||||
// format
|
||||
schedule?: string
|
||||
|
||||
// TimeZone of the sync that will be applied to the schedule
|
||||
timeZone?: string
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-mesh-certmanager/prod-mesh-certmanager.gen.yaml
|
||||
|
||||
package v1
|
||||
|
||||
import "strings"
|
||||
|
||||
// A Certificate resource should be created to ensure an up to
|
||||
// date and signed X.509 certificate is stored in the Kubernetes
|
||||
// Secret resource named in `spec.secretName`.
|
||||
// The stored certificate will be renewed before it expires (as
|
||||
// configured by `spec.renewBefore`).
|
||||
#Certificate: {
|
||||
// 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
|
||||
apiVersion: "cert-manager.io/v1"
|
||||
|
||||
// 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
|
||||
kind: "Certificate"
|
||||
metadata!: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
|
||||
// Specification of the desired state of the Certificate resource.
|
||||
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
spec!: #CertificateSpec
|
||||
}
|
||||
|
||||
// Specification of the desired state of the Certificate resource.
|
||||
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
#CertificateSpec: {
|
||||
// Defines extra output formats of the private key and signed
|
||||
// certificate chain to be written to this Certificate's target
|
||||
// Secret.
|
||||
// This is an Alpha Feature and is only enabled with the
|
||||
// `--feature-gates=AdditionalCertificateOutputFormats=true`
|
||||
// option set on both the controller and webhook components.
|
||||
additionalOutputFormats?: [...{
|
||||
// Type is the name of the format type that should be written to
|
||||
// the Certificate's target Secret.
|
||||
type: "DER" | "CombinedPEM"
|
||||
}]
|
||||
|
||||
// Requested common name X509 certificate subject attribute. More
|
||||
// info:
|
||||
// https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
|
||||
// NOTE: TLS clients will ignore this value when any subject
|
||||
// alternative name is set (see
|
||||
// https://tools.ietf.org/html/rfc6125#section-6.4.4).
|
||||
// Should have a length of 64 characters or fewer to avoid
|
||||
// generating invalid CSRs. Cannot be set if the `literalSubject`
|
||||
// field is set.
|
||||
commonName?: string
|
||||
|
||||
// Requested DNS subject alternative names.
|
||||
dnsNames?: [...string]
|
||||
|
||||
// Requested 'duration' (i.e. lifetime) of the Certificate. Note
|
||||
// that the issuer may choose to ignore the requested duration,
|
||||
// just like any other requested attribute.
|
||||
// If unset, this defaults to 90 days. Minimum accepted duration
|
||||
// is 1 hour. Value must be in units accepted by Go
|
||||
// time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
|
||||
duration?: string
|
||||
|
||||
// Requested email subject alternative names.
|
||||
emailAddresses?: [...string]
|
||||
|
||||
// Whether the KeyUsage and ExtKeyUsage extensions should be set
|
||||
// in the encoded CSR.
|
||||
// This option defaults to true, and should only be disabled if
|
||||
// the target issuer does not support CSRs with these X509
|
||||
// KeyUsage/ ExtKeyUsage extensions.
|
||||
encodeUsagesInRequest?: bool
|
||||
|
||||
// Requested IP address subject alternative names.
|
||||
ipAddresses?: [...string]
|
||||
|
||||
// Requested basic constraints isCA value. The isCA value is used
|
||||
// to set the `isCA` field on the created CertificateRequest
|
||||
// resources. Note that the issuer may choose to ignore the
|
||||
// requested isCA value, just like any other requested attribute.
|
||||
// If true, this will automatically add the `cert sign` usage to
|
||||
// the list of requested `usages`.
|
||||
isCA?: bool
|
||||
|
||||
// Reference to the issuer responsible for issuing the
|
||||
// certificate. If the issuer is namespace-scoped, it must be in
|
||||
// the same namespace as the Certificate. If the issuer is
|
||||
// cluster-scoped, it can be used from any namespace.
|
||||
// The `name` field of the reference must always be specified.
|
||||
issuerRef: {
|
||||
// Group of the resource being referred to.
|
||||
group?: string
|
||||
|
||||
// Kind of the resource being referred to.
|
||||
kind?: string
|
||||
|
||||
// Name of the resource being referred to.
|
||||
name: string
|
||||
}
|
||||
|
||||
// Additional keystore output formats to be stored in the
|
||||
// Certificate's Secret.
|
||||
keystores?: {
|
||||
// JKS configures options for storing a JKS keystore in the
|
||||
// `spec.secretName` Secret resource.
|
||||
jks?: {
|
||||
// Create enables JKS keystore creation for the Certificate. If
|
||||
// true, a file named `keystore.jks` will be created in the
|
||||
// target Secret resource, encrypted using the password stored in
|
||||
// `passwordSecretRef`. The keystore file will be updated
|
||||
// immediately. If the issuer provided a CA certificate, a file
|
||||
// named `truststore.jks` will also be created in the target
|
||||
// Secret resource, encrypted using the password stored in
|
||||
// `passwordSecretRef` containing the issuing Certificate
|
||||
// Authority
|
||||
create: bool
|
||||
|
||||
// PasswordSecretRef is a reference to a key in a Secret resource
|
||||
// containing the password used to encrypt the JKS keystore.
|
||||
passwordSecretRef: {
|
||||
// The key of the entry in the Secret resource's `data` field to
|
||||
// be used. Some instances of this field may be defaulted, in
|
||||
// others it may be required.
|
||||
key?: string
|
||||
|
||||
// Name of the resource being referred to. More info:
|
||||
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
// PKCS12 configures options for storing a PKCS12 keystore in the
|
||||
// `spec.secretName` Secret resource.
|
||||
pkcs12?: {
|
||||
// Create enables PKCS12 keystore creation for the Certificate. If
|
||||
// true, a file named `keystore.p12` will be created in the
|
||||
// target Secret resource, encrypted using the password stored in
|
||||
// `passwordSecretRef`. The keystore file will be updated
|
||||
// immediately. If the issuer provided a CA certificate, a file
|
||||
// named `truststore.p12` will also be created in the target
|
||||
// Secret resource, encrypted using the password stored in
|
||||
// `passwordSecretRef` containing the issuing Certificate
|
||||
// Authority
|
||||
create: bool
|
||||
|
||||
// PasswordSecretRef is a reference to a key in a Secret resource
|
||||
// containing the password used to encrypt the PKCS12 keystore.
|
||||
passwordSecretRef: {
|
||||
// The key of the entry in the Secret resource's `data` field to
|
||||
// be used. Some instances of this field may be defaulted, in
|
||||
// others it may be required.
|
||||
key?: string
|
||||
|
||||
// Name of the resource being referred to. More info:
|
||||
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
name: string
|
||||
}
|
||||
|
||||
// Profile specifies the key and certificate encryption algorithms
|
||||
// and the HMAC algorithm used to create the PKCS12 keystore.
|
||||
// Default value is `LegacyRC2` for backward compatibility.
|
||||
// If provided, allowed values are: `LegacyRC2`: Deprecated. Not
|
||||
// supported by default in OpenSSL 3 or Java 20. `LegacyDES`:
|
||||
// Less secure algorithm. Use this option for maximal
|
||||
// compatibility. `Modern2023`: Secure algorithm. Use this option
|
||||
// in case you have to always use secure algorithms (eg. because
|
||||
// of company policy). Please note that the security of the
|
||||
// algorithm is not that important in reality, because the
|
||||
// unencrypted certificate and private key are also stored in the
|
||||
// Secret.
|
||||
profile?: "LegacyRC2" | "LegacyDES" | "Modern2023"
|
||||
}
|
||||
}
|
||||
|
||||
// Requested X.509 certificate subject, represented using the LDAP
|
||||
// "String Representation of a Distinguished Name" [1].
|
||||
// Important: the LDAP string format also specifies the order of
|
||||
// the attributes in the subject, this is important when issuing
|
||||
// certs for LDAP authentication. Example:
|
||||
// `CN=foo,DC=corp,DC=example,DC=com` More info [1]:
|
||||
// https://datatracker.ietf.org/doc/html/rfc4514 More info:
|
||||
// https://github.com/cert-manager/cert-manager/issues/3203 More
|
||||
// info: https://github.com/cert-manager/cert-manager/issues/4424
|
||||
// Cannot be set if the `subject` or `commonName` field is set.
|
||||
// This is an Alpha Feature and is only enabled with the
|
||||
// `--feature-gates=LiteralCertificateSubject=true` option set on
|
||||
// both the controller and webhook components.
|
||||
literalSubject?: string
|
||||
|
||||
// x.509 certificate NameConstraint extension which MUST NOT be
|
||||
// used in a non-CA certificate. More Info:
|
||||
// https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10
|
||||
// This is an Alpha Feature and is only enabled with the
|
||||
// `--feature-gates=NameConstraints=true` option set on both the
|
||||
// controller and webhook components.
|
||||
nameConstraints?: {
|
||||
// if true then the name constraints are marked critical.
|
||||
critical?: bool
|
||||
|
||||
// Excluded contains the constraints which must be disallowed. Any
|
||||
// name matching a restriction in the excluded field is invalid
|
||||
// regardless of information appearing in the permitted
|
||||
excluded?: {
|
||||
// DNSDomains is a list of DNS domains that are permitted or
|
||||
// excluded.
|
||||
dnsDomains?: [...string]
|
||||
|
||||
// EmailAddresses is a list of Email Addresses that are permitted
|
||||
// or excluded.
|
||||
emailAddresses?: [...string]
|
||||
|
||||
// IPRanges is a list of IP Ranges that are permitted or excluded.
|
||||
// This should be a valid CIDR notation.
|
||||
ipRanges?: [...string]
|
||||
|
||||
// URIDomains is a list of URI domains that are permitted or
|
||||
// excluded.
|
||||
uriDomains?: [...string]
|
||||
}
|
||||
|
||||
// Permitted contains the constraints in which the names must be
|
||||
// located.
|
||||
permitted?: {
|
||||
// DNSDomains is a list of DNS domains that are permitted or
|
||||
// excluded.
|
||||
dnsDomains?: [...string]
|
||||
|
||||
// EmailAddresses is a list of Email Addresses that are permitted
|
||||
// or excluded.
|
||||
emailAddresses?: [...string]
|
||||
|
||||
// IPRanges is a list of IP Ranges that are permitted or excluded.
|
||||
// This should be a valid CIDR notation.
|
||||
ipRanges?: [...string]
|
||||
|
||||
// URIDomains is a list of URI domains that are permitted or
|
||||
// excluded.
|
||||
uriDomains?: [...string]
|
||||
}
|
||||
}
|
||||
|
||||
// `otherNames` is an escape hatch for SAN that allows any type.
|
||||
// We currently restrict the support to string like otherNames,
|
||||
// cf RFC 5280 p 37 Any UTF8 String valued otherName can be
|
||||
// passed with by setting the keys oid: x.x.x.x and UTF8Value:
|
||||
// somevalue for `otherName`. Most commonly this would be UPN set
|
||||
// with oid: 1.3.6.1.4.1.311.20.2.3 You should ensure that any
|
||||
// OID passed is valid for the UTF8String type as we do not
|
||||
// explicitly validate this.
|
||||
otherNames?: [...{
|
||||
// OID is the object identifier for the otherName SAN. The object
|
||||
// identifier must be expressed as a dotted string, for example,
|
||||
// "1.2.840.113556.1.4.221".
|
||||
oid?: string
|
||||
|
||||
// utf8Value is the string value of the otherName SAN. The
|
||||
// utf8Value accepts any valid UTF8 string to set as value for
|
||||
// the otherName SAN.
|
||||
utf8Value?: string
|
||||
}]
|
||||
|
||||
// Private key options. These include the key algorithm and size,
|
||||
// the used encoding and the rotation policy.
|
||||
privateKey?: {
|
||||
// Algorithm is the private key algorithm of the corresponding
|
||||
// private key for this certificate.
|
||||
// If provided, allowed values are either `RSA`, `ECDSA` or
|
||||
// `Ed25519`. If `algorithm` is specified and `size` is not
|
||||
// provided, key size of 2048 will be used for `RSA` key
|
||||
// algorithm and key size of 256 will be used for `ECDSA` key
|
||||
// algorithm. key size is ignored when using the `Ed25519` key
|
||||
// algorithm.
|
||||
algorithm?: "RSA" | "ECDSA" | "Ed25519"
|
||||
|
||||
// The private key cryptography standards (PKCS) encoding for this
|
||||
// certificate's private key to be encoded in.
|
||||
// If provided, allowed values are `PKCS1` and `PKCS8` standing
|
||||
// for PKCS#1 and PKCS#8, respectively. Defaults to `PKCS1` if
|
||||
// not specified.
|
||||
encoding?: "PKCS1" | "PKCS8"
|
||||
|
||||
// RotationPolicy controls how private keys should be regenerated
|
||||
// when a re-issuance is being processed.
|
||||
// If set to `Never`, a private key will only be generated if one
|
||||
// does not already exist in the target `spec.secretName`. If one
|
||||
// does exists but it does not have the correct algorithm or
|
||||
// size, a warning will be raised to await user intervention. If
|
||||
// set to `Always`, a private key matching the specified
|
||||
// requirements will be generated whenever a re-issuance occurs.
|
||||
// Default is `Never` for backward compatibility.
|
||||
rotationPolicy?: "Never" | "Always"
|
||||
|
||||
// Size is the key bit size of the corresponding private key for
|
||||
// this certificate.
|
||||
// If `algorithm` is set to `RSA`, valid values are `2048`, `4096`
|
||||
// or `8192`, and will default to `2048` if not specified. If
|
||||
// `algorithm` is set to `ECDSA`, valid values are `256`, `384`
|
||||
// or `521`, and will default to `256` if not specified. If
|
||||
// `algorithm` is set to `Ed25519`, Size is ignored. No other
|
||||
// values are allowed.
|
||||
size?: int
|
||||
}
|
||||
|
||||
// How long before the currently issued certificate's expiry
|
||||
// cert-manager should renew the certificate. For example, if a
|
||||
// certificate is valid for 60 minutes, and `renewBefore=10m`,
|
||||
// cert-manager will begin to attempt to renew the certificate 50
|
||||
// minutes after it was issued (i.e. when there are 10 minutes
|
||||
// remaining until the certificate is no longer valid).
|
||||
// NOTE: The actual lifetime of the issued certificate is used to
|
||||
// determine the renewal time. If an issuer returns a certificate
|
||||
// with a different lifetime than the one requested, cert-manager
|
||||
// will use the lifetime of the issued certificate.
|
||||
// If unset, this defaults to 1/3 of the issued certificate's
|
||||
// lifetime. Minimum accepted value is 5 minutes. Value must be
|
||||
// in units accepted by Go time.ParseDuration
|
||||
// https://golang.org/pkg/time/#ParseDuration.
|
||||
renewBefore?: string
|
||||
|
||||
// The maximum number of CertificateRequest revisions that are
|
||||
// maintained in the Certificate's history. Each revision
|
||||
// represents a single `CertificateRequest` created by this
|
||||
// Certificate, either when it was created, renewed, or Spec was
|
||||
// changed. Revisions will be removed by oldest first if the
|
||||
// number of revisions exceeds this number.
|
||||
// If set, revisionHistoryLimit must be a value of `1` or greater.
|
||||
// If unset (`nil`), revisions will not be garbage collected.
|
||||
// Default value is `nil`.
|
||||
revisionHistoryLimit?: int
|
||||
|
||||
// Name of the Secret resource that will be automatically created
|
||||
// and managed by this Certificate resource. It will be populated
|
||||
// with a private key and certificate, signed by the denoted
|
||||
// issuer. The Secret resource lives in the same namespace as the
|
||||
// Certificate resource.
|
||||
secretName: string
|
||||
|
||||
// Defines annotations and labels to be copied to the
|
||||
// Certificate's Secret. Labels and annotations on the Secret
|
||||
// will be changed as they appear on the SecretTemplate when
|
||||
// added or removed. SecretTemplate annotations are added in
|
||||
// conjunction with, and cannot overwrite, the base set of
|
||||
// annotations cert-manager sets on the Certificate's Secret.
|
||||
secretTemplate?: {
|
||||
// Annotations is a key value map to be copied to the target
|
||||
// Kubernetes Secret.
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
|
||||
// Labels is a key value map to be copied to the target Kubernetes
|
||||
// Secret.
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
|
||||
// Requested set of X509 certificate subject attributes. More
|
||||
// info:
|
||||
// https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
|
||||
// The common name attribute is specified separately in the
|
||||
// `commonName` field. Cannot be set if the `literalSubject`
|
||||
// field is set.
|
||||
subject?: {
|
||||
// Countries to be used on the Certificate.
|
||||
countries?: [...string]
|
||||
|
||||
// Cities to be used on the Certificate.
|
||||
localities?: [...string]
|
||||
|
||||
// Organizational Units to be used on the Certificate.
|
||||
organizationalUnits?: [...string]
|
||||
|
||||
// Organizations to be used on the Certificate.
|
||||
organizations?: [...string]
|
||||
|
||||
// Postal codes to be used on the Certificate.
|
||||
postalCodes?: [...string]
|
||||
|
||||
// State/Provinces to be used on the Certificate.
|
||||
provinces?: [...string]
|
||||
|
||||
// Serial number to be used on the Certificate.
|
||||
serialNumber?: string
|
||||
|
||||
// Street addresses to be used on the Certificate.
|
||||
streetAddresses?: [...string]
|
||||
}
|
||||
|
||||
// Requested URI subject alternative names.
|
||||
uris?: [...string]
|
||||
|
||||
// Requested key usages and extended key usages. These usages are
|
||||
// used to set the `usages` field on the created
|
||||
// CertificateRequest resources. If `encodeUsagesInRequest` is
|
||||
// unset or set to `true`, the usages will additionally be
|
||||
// encoded in the `request` field which contains the CSR blob.
|
||||
// If unset, defaults to `digital signature` and `key
|
||||
// encipherment`.
|
||||
usages?: [..."signing" | "digital signature" | "content commitment" | "key encipherment" | "key agreement" | "data encipherment" | "cert sign" | "crl sign" | "encipher only" | "decipher only" | "any" | "server auth" | "client auth" | "code signing" | "email protection" | "s/mime" | "ipsec end system" | "ipsec tunnel" | "ipsec user" | "timestamping" | "ocsp signing" | "microsoft sgc" | "netscape sgc"]
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-mesh-certmanager/prod-mesh-certmanager.gen.yaml
|
||||
|
||||
package v1
|
||||
|
||||
import "strings"
|
||||
|
||||
// A CertificateRequest is used to request a signed certificate
|
||||
// from one of the configured issuers.
|
||||
// All fields within the CertificateRequest's `spec` are immutable
|
||||
// after creation. A CertificateRequest will either succeed or
|
||||
// fail, as denoted by its `Ready` status condition and its
|
||||
// `status.failureTime` field.
|
||||
// A CertificateRequest is a one-shot resource, meaning it
|
||||
// represents a single point in time request for a certificate
|
||||
// and cannot be re-used.
|
||||
#CertificateRequest: {
|
||||
// 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
|
||||
apiVersion: "cert-manager.io/v1"
|
||||
|
||||
// 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
|
||||
kind: "CertificateRequest"
|
||||
metadata!: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
|
||||
// Specification of the desired state of the CertificateRequest
|
||||
// resource.
|
||||
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
spec!: #CertificateRequestSpec
|
||||
}
|
||||
|
||||
// Specification of the desired state of the CertificateRequest
|
||||
// resource.
|
||||
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
#CertificateRequestSpec: {
|
||||
// Requested 'duration' (i.e. lifetime) of the Certificate. Note
|
||||
// that the issuer may choose to ignore the requested duration,
|
||||
// just like any other requested attribute.
|
||||
duration?: string
|
||||
|
||||
// Extra contains extra attributes of the user that created the
|
||||
// CertificateRequest. Populated by the cert-manager webhook on
|
||||
// creation and immutable.
|
||||
extra?: {
|
||||
[string]: [...string]
|
||||
}
|
||||
|
||||
// Groups contains group membership of the user that created the
|
||||
// CertificateRequest. Populated by the cert-manager webhook on
|
||||
// creation and immutable.
|
||||
groups?: [...string]
|
||||
|
||||
// Requested basic constraints isCA value. Note that the issuer
|
||||
// may choose to ignore the requested isCA value, just like any
|
||||
// other requested attribute.
|
||||
// NOTE: If the CSR in the `Request` field has a BasicConstraints
|
||||
// extension, it must have the same isCA value as specified here.
|
||||
// If true, this will automatically add the `cert sign` usage to
|
||||
// the list of requested `usages`.
|
||||
isCA?: bool
|
||||
|
||||
// Reference to the issuer responsible for issuing the
|
||||
// certificate. If the issuer is namespace-scoped, it must be in
|
||||
// the same namespace as the Certificate. If the issuer is
|
||||
// cluster-scoped, it can be used from any namespace.
|
||||
// The `name` field of the reference must always be specified.
|
||||
issuerRef: {
|
||||
// Group of the resource being referred to.
|
||||
group?: string
|
||||
|
||||
// Kind of the resource being referred to.
|
||||
kind?: string
|
||||
|
||||
// Name of the resource being referred to.
|
||||
name: string
|
||||
}
|
||||
|
||||
// The PEM-encoded X.509 certificate signing request to be
|
||||
// submitted to the issuer for signing.
|
||||
// If the CSR has a BasicConstraints extension, its isCA attribute
|
||||
// must match the `isCA` value of this CertificateRequest. If the
|
||||
// CSR has a KeyUsage extension, its key usages must match the
|
||||
// key usages in the `usages` field of this CertificateRequest.
|
||||
// If the CSR has a ExtKeyUsage extension, its extended key
|
||||
// usages must match the extended key usages in the `usages`
|
||||
// field of this CertificateRequest.
|
||||
request: string
|
||||
|
||||
// UID contains the uid of the user that created the
|
||||
// CertificateRequest. Populated by the cert-manager webhook on
|
||||
// creation and immutable.
|
||||
uid?: string
|
||||
|
||||
// Requested key usages and extended key usages.
|
||||
// NOTE: If the CSR in the `Request` field has uses the KeyUsage
|
||||
// or ExtKeyUsage extension, these extensions must have the same
|
||||
// values as specified here without any additional values.
|
||||
// If unset, defaults to `digital signature` and `key
|
||||
// encipherment`.
|
||||
usages?: [..."signing" | "digital signature" | "content commitment" | "key encipherment" | "key agreement" | "data encipherment" | "cert sign" | "crl sign" | "encipher only" | "decipher only" | "any" | "server auth" | "client auth" | "code signing" | "email protection" | "s/mime" | "ipsec end system" | "ipsec tunnel" | "ipsec user" | "timestamping" | "ocsp signing" | "microsoft sgc" | "netscape sgc"]
|
||||
|
||||
// Username contains the name of the user that created the
|
||||
// CertificateRequest. Populated by the cert-manager webhook on
|
||||
// creation and immutable.
|
||||
username?: string
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1589
docs/examples/cue.mod/gen/cert-manager.io/issuer/v1/types_gen.cue
Normal file
1589
docs/examples/cue.mod/gen/cert-manager.io/issuer/v1/types_gen.cue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,123 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-mesh-istio-base/prod-mesh-istio-base.gen.yaml
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"list"
|
||||
)
|
||||
|
||||
#WasmPlugin: {
|
||||
// Extend the functionality provided by the Istio proxy through
|
||||
// WebAssembly filters. See more details at:
|
||||
// https://istio.io/docs/reference/config/proxy_extensions/wasm-plugin.html
|
||||
spec!: #WasmPluginSpec
|
||||
apiVersion: "extensions.istio.io/v1alpha1"
|
||||
kind: "WasmPlugin"
|
||||
metadata!: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extend the functionality provided by the Istio proxy through
|
||||
// WebAssembly filters. See more details at:
|
||||
// https://istio.io/docs/reference/config/proxy_extensions/wasm-plugin.html
|
||||
#WasmPluginSpec: {
|
||||
// Specifies the failure behavior for the plugin due to fatal
|
||||
// errors.
|
||||
failStrategy?: "FAIL_CLOSE" | "FAIL_OPEN"
|
||||
|
||||
// The pull behaviour to be applied when fetching Wasm module by
|
||||
// either OCI image or http/https.
|
||||
imagePullPolicy?: "UNSPECIFIED_POLICY" | "IfNotPresent" | "Always"
|
||||
|
||||
// Credentials to use for OCI image pulling.
|
||||
imagePullSecret?: strings.MaxRunes(253) & strings.MinRunes(1)
|
||||
|
||||
// Specifies the criteria to determine which traffic is passed to
|
||||
// WasmPlugin.
|
||||
match?: [...{
|
||||
// Criteria for selecting traffic by their direction.
|
||||
mode?: "UNDEFINED" | "CLIENT" | "SERVER" | "CLIENT_AND_SERVER"
|
||||
|
||||
// Criteria for selecting traffic by their destination port.
|
||||
ports?: [...{
|
||||
number: uint16 & >=1
|
||||
}]
|
||||
}]
|
||||
|
||||
// Determines where in the filter chain this `WasmPlugin` is to be
|
||||
// injected.
|
||||
phase?: "UNSPECIFIED_PHASE" | "AUTHN" | "AUTHZ" | "STATS"
|
||||
|
||||
// The configuration that will be passed on to the plugin.
|
||||
pluginConfig?: {
|
||||
...
|
||||
}
|
||||
|
||||
// The plugin name to be used in the Envoy configuration (used to
|
||||
// be called `rootID`).
|
||||
pluginName?: strings.MaxRunes(256) & strings.MinRunes(1)
|
||||
|
||||
// Determines ordering of `WasmPlugins` in the same `phase`.
|
||||
priority?: null | int
|
||||
selector?: {
|
||||
// One or more labels that indicate a specific set of pods/VMs on
|
||||
// which a policy should be applied.
|
||||
matchLabels?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
|
||||
// SHA256 checksum that will be used to verify Wasm module or OCI
|
||||
// container.
|
||||
sha256?: =~"(^$|^[a-f0-9]{64}$)"
|
||||
|
||||
// Optional.
|
||||
targetRef?: {
|
||||
// group is the group of the target resource.
|
||||
group?: string
|
||||
|
||||
// kind is kind of the target resource.
|
||||
kind?: string
|
||||
|
||||
// name is the name of the target resource.
|
||||
name?: string
|
||||
|
||||
// namespace is the namespace of the referent.
|
||||
namespace?: string
|
||||
}
|
||||
|
||||
// Specifies the type of Wasm Extension to be used.
|
||||
type?: "UNSPECIFIED_PLUGIN_TYPE" | "HTTP" | "NETWORK"
|
||||
|
||||
// URL of a Wasm module or OCI container.
|
||||
url: strings.MinRunes(1)
|
||||
verificationKey?: string
|
||||
vmConfig?: {
|
||||
// Specifies environment variables to be injected to this VM.
|
||||
env?: list.MaxItems(256) & [...{
|
||||
// Name of the environment variable.
|
||||
name: strings.MaxRunes(256) & strings.MinRunes(1)
|
||||
|
||||
// Value for the environment variable.
|
||||
value?: strings.MaxRunes(2048)
|
||||
|
||||
// Source for the environment variable's value.
|
||||
valueFrom?: "INLINE" | "HOST"
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -922,7 +922,7 @@ import (
|
||||
kubernetes?: {
|
||||
// Auth configures how secret-manager authenticates with a
|
||||
// Kubernetes instance.
|
||||
auth: struct.MaxFields(1) & {
|
||||
auth: {
|
||||
// has both clientCert and clientKey as secretKeySelector
|
||||
cert?: {
|
||||
// A reference to a specific 'key' within a Secret resource,
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// BuildPlan is the primary interface between CUE and the Holos cli.
|
||||
#BuildPlan: {
|
||||
#TypeMeta
|
||||
|
||||
// Metadata represents the holos component name
|
||||
metadata?: #ObjectMeta @go(Metadata)
|
||||
spec?: #BuildPlanSpec @go(Spec)
|
||||
}
|
||||
|
||||
#BuildPlanSpec: {
|
||||
disabled?: bool @go(Disabled)
|
||||
components?: #BuildPlanComponents @go(Components)
|
||||
}
|
||||
|
||||
#BuildPlanComponents: {
|
||||
helmChartList?: [...#HelmChart] @go(HelmChartList,[]HelmChart)
|
||||
kubernetesObjectsList?: [...#KubernetesObjects] @go(KubernetesObjectsList,[]KubernetesObjects)
|
||||
kustomizeBuildList?: [...#KustomizeBuild] @go(KustomizeBuildList,[]KustomizeBuild)
|
||||
resources?: {[string]: #KubernetesObjects} @go(Resources,map[string]KubernetesObjects)
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// HolosComponent defines the fields common to all holos component kinds including the Render Result.
|
||||
#HolosComponent: {
|
||||
#TypeMeta
|
||||
|
||||
// Metadata represents the holos component name
|
||||
metadata?: #ObjectMeta @go(Metadata)
|
||||
|
||||
// APIObjectMap holds the marshalled representation of api objects. Think of
|
||||
// these as resources overlaid at the back of the render pipeline.
|
||||
apiObjectMap?: #APIObjectMap @go(APIObjectMap)
|
||||
|
||||
#Kustomization
|
||||
|
||||
#Kustomize
|
||||
|
||||
// Skip causes holos to take no action regarding the component.
|
||||
Skip: bool
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#APIVersion: "holos.run/v1alpha1"
|
||||
#BuildPlanKind: "BuildPlan"
|
||||
#HelmChartKind: "HelmChart"
|
||||
|
||||
// ChartDir is the directory name created in the holos component directory to cache a chart.
|
||||
#ChartDir: "vendor"
|
||||
|
||||
// ResourcesFile is the file name used to store component output when post-processing with kustomize.
|
||||
#ResourcesFile: "resources.yaml"
|
||||
@@ -0,0 +1,6 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
// Package v1alpha1 defines the api boundary between CUE and Holos.
|
||||
package v1alpha1
|
||||
@@ -0,0 +1,28 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// A HelmChart represents a helm command to provide chart values in order to render kubernetes api objects.
|
||||
#HelmChart: {
|
||||
#HolosComponent
|
||||
|
||||
// Namespace is the namespace to install into. TODO: Use metadata.namespace instead.
|
||||
namespace: string @go(Namespace)
|
||||
chart: #Chart @go(Chart)
|
||||
valuesContent: string @go(ValuesContent)
|
||||
enableHooks: bool @go(EnableHooks)
|
||||
}
|
||||
|
||||
#Chart: {
|
||||
name: string @go(Name)
|
||||
version: string @go(Version)
|
||||
release: string @go(Release)
|
||||
repository?: #Repository @go(Repository)
|
||||
}
|
||||
|
||||
#Repository: {
|
||||
name: string @go(Name)
|
||||
url: string @go(URL)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#KubernetesObjectsKind: "KubernetesObjects"
|
||||
|
||||
// KubernetesObjects represents CUE output which directly provides Kubernetes api objects to holos.
|
||||
#KubernetesObjects: {
|
||||
#HolosComponent
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// Kustomization holds the rendered flux kustomization api object content for git ops.
|
||||
#Kustomization: {
|
||||
// KsContent is the yaml representation of the flux kustomization for gitops.
|
||||
ksContent?: string @go(KsContent)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#KustomizeBuildKind: "KustomizeBuild"
|
||||
|
||||
// Kustomize represents resources necessary to execute a kustomize build.
|
||||
// Intended for at least two use cases:
|
||||
//
|
||||
// 1. Process raw yaml file resources in a holos component directory.
|
||||
// 2. Post process a HelmChart to inject istio, add custom labels, etc...
|
||||
#Kustomize: {
|
||||
// KustomizeFiles holds file contents for kustomize, e.g. patch files.
|
||||
kustomizeFiles?: #FileContentMap @go(KustomizeFiles)
|
||||
|
||||
// ResourcesFile is the file name used for api objects in kustomization.yaml
|
||||
resourcesFile?: string @go(ResourcesFile)
|
||||
}
|
||||
|
||||
// KustomizeBuild renders plain yaml files in the holos component directory using kubectl kustomize build.
|
||||
#KustomizeBuild: {
|
||||
#HolosComponent
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#KustomizeBuildKind: "KustomizeBuild"
|
||||
|
||||
// KustomizeBuild
|
||||
#KustomizeBuild: {
|
||||
#HolosComponent
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// Label is an arbitrary unique identifier. Defined as a type for clarity and type checking.
|
||||
#Label: string
|
||||
|
||||
// Kind is a kubernetes api object kind. Defined as a type for clarity and type checking.
|
||||
#Kind: string
|
||||
|
||||
// APIObjectMap is the shape of marshalled api objects returned from cue to the
|
||||
// holos cli. A map is used to improve the clarity of error messages from cue.
|
||||
#APIObjectMap: {[string]: [string]: string}
|
||||
|
||||
// FileContentMap is a map of file names to file contents.
|
||||
#FileContentMap: {[string]: string}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// ObjectMeta represents metadata of a holos component object. The fields are a
|
||||
// copy of upstream kubernetes api machinery but are by holos objects distinct
|
||||
// from kubernetes api objects.
|
||||
#ObjectMeta: {
|
||||
// Name uniquely identifies the holos component instance and must be suitable as a file name.
|
||||
name?: string @go(Name)
|
||||
|
||||
// Namespace confines a holos component to a single namespace via kustomize if set.
|
||||
namespace?: string @go(Namespace)
|
||||
|
||||
// Labels are not used but are copied from api machinery ObjectMeta for completeness.
|
||||
labels?: {[string]: string} @go(Labels,map[string]string)
|
||||
|
||||
// Annotations are not used but are copied from api machinery ObjectMeta for completeness.
|
||||
annotations?: {[string]: string} @go(Annotations,map[string]string)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#Renderer: _
|
||||
@@ -0,0 +1,10 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// Result is the build result for display or writing. Holos components Render the Result as a data pipeline.
|
||||
#Result: {
|
||||
HolosComponent: #HolosComponent
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go github.com/holos-run/holos/api/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#TypeMeta: {
|
||||
kind?: string @go(Kind)
|
||||
apiVersion?: string @go(APIVersion)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by timoni. DO NOT EDIT.
|
||||
|
||||
//timoni:generate timoni vendor crd -f /home/jeff/workspace/holos-run/holos-infra/deploy/clusters/k2/components/prod-mesh-istio-base/prod-mesh-istio-base.gen.yaml
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import "strings"
|
||||
|
||||
#IstioOperator: {
|
||||
apiVersion: "install.istio.io/v1alpha1"
|
||||
kind: "IstioOperator"
|
||||
metadata!: {
|
||||
name!: strings.MaxRunes(253) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
namespace!: strings.MaxRunes(63) & strings.MinRunes(1) & {
|
||||
string
|
||||
}
|
||||
labels?: {
|
||||
[string]: string
|
||||
}
|
||||
annotations?: {
|
||||
[string]: string
|
||||
}
|
||||
}
|
||||
...
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admission/v1
|
||||
|
||||
package v1
|
||||
|
||||
#GroupName: "admission.k8s.io"
|
||||
@@ -0,0 +1,172 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admission/v1
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
authenticationv1 "k8s.io/api/authentication/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// AdmissionReview describes an admission review request/response.
|
||||
#AdmissionReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Request describes the attributes for the admission request.
|
||||
// +optional
|
||||
request?: null | #AdmissionRequest @go(Request,*AdmissionRequest) @protobuf(1,bytes,opt)
|
||||
|
||||
// Response describes the attributes for the admission response.
|
||||
// +optional
|
||||
response?: null | #AdmissionResponse @go(Response,*AdmissionResponse) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// AdmissionRequest describes the admission.Attributes for the admission request.
|
||||
#AdmissionRequest: {
|
||||
// UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
|
||||
// otherwise identical (parallel requests, requests when earlier requests did not modify etc)
|
||||
// The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.
|
||||
// It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
|
||||
uid: types.#UID @go(UID) @protobuf(1,bytes,opt)
|
||||
|
||||
// Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)
|
||||
kind: metav1.#GroupVersionKind @go(Kind) @protobuf(2,bytes,opt)
|
||||
|
||||
// Resource is the fully-qualified resource being requested (for example, v1.pods)
|
||||
resource: metav1.#GroupVersionResource @go(Resource) @protobuf(3,bytes,opt)
|
||||
|
||||
// SubResource is the subresource being requested, if any (for example, "status" or "scale")
|
||||
// +optional
|
||||
subResource?: string @go(SubResource) @protobuf(4,bytes,opt)
|
||||
|
||||
// RequestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale).
|
||||
// If this is specified and differs from the value in "kind", an equivalent match and conversion was performed.
|
||||
//
|
||||
// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
|
||||
// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
|
||||
// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
|
||||
// with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the rule the webhook registered for),
|
||||
// and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}` (indicating the kind of the original API request).
|
||||
//
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type for more details.
|
||||
// +optional
|
||||
requestKind?: null | metav1.#GroupVersionKind @go(RequestKind,*metav1.GroupVersionKind) @protobuf(13,bytes,opt)
|
||||
|
||||
// RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
|
||||
// If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
|
||||
//
|
||||
// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
|
||||
// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
|
||||
// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
|
||||
// with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
|
||||
// and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original API request).
|
||||
//
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type.
|
||||
// +optional
|
||||
requestResource?: null | metav1.#GroupVersionResource @go(RequestResource,*metav1.GroupVersionResource) @protobuf(14,bytes,opt)
|
||||
|
||||
// RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
|
||||
// If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type.
|
||||
// +optional
|
||||
requestSubResource?: string @go(RequestSubResource) @protobuf(15,bytes,opt)
|
||||
|
||||
// Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
|
||||
// rely on the server to generate the name. If that is the case, this field will contain an empty string.
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(5,bytes,opt)
|
||||
|
||||
// Namespace is the namespace associated with the request (if any).
|
||||
// +optional
|
||||
namespace?: string @go(Namespace) @protobuf(6,bytes,opt)
|
||||
|
||||
// Operation is the operation being performed. This may be different than the operation
|
||||
// requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
|
||||
operation: #Operation @go(Operation) @protobuf(7,bytes,opt)
|
||||
|
||||
// UserInfo is information about the requesting user
|
||||
userInfo: authenticationv1.#UserInfo @go(UserInfo) @protobuf(8,bytes,opt)
|
||||
|
||||
// Object is the object from the incoming request.
|
||||
// +optional
|
||||
object?: runtime.#RawExtension @go(Object) @protobuf(9,bytes,opt)
|
||||
|
||||
// OldObject is the existing object. Only populated for DELETE and UPDATE requests.
|
||||
// +optional
|
||||
oldObject?: runtime.#RawExtension @go(OldObject) @protobuf(10,bytes,opt)
|
||||
|
||||
// DryRun indicates that modifications will definitely not be persisted for this request.
|
||||
// Defaults to false.
|
||||
// +optional
|
||||
dryRun?: null | bool @go(DryRun,*bool) @protobuf(11,varint,opt)
|
||||
|
||||
// Options is the operation option structure of the operation being performed.
|
||||
// e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
|
||||
// different than the options the caller provided. e.g. for a patch request the performed
|
||||
// Operation might be a CREATE, in which case the Options will a
|
||||
// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
|
||||
// +optional
|
||||
options?: runtime.#RawExtension @go(Options) @protobuf(12,bytes,opt)
|
||||
}
|
||||
|
||||
// AdmissionResponse describes an admission response.
|
||||
#AdmissionResponse: {
|
||||
// UID is an identifier for the individual request/response.
|
||||
// This must be copied over from the corresponding AdmissionRequest.
|
||||
uid: types.#UID @go(UID) @protobuf(1,bytes,opt)
|
||||
|
||||
// Allowed indicates whether or not the admission request was permitted.
|
||||
allowed: bool @go(Allowed) @protobuf(2,varint,opt)
|
||||
|
||||
// Result contains extra details into why an admission request was denied.
|
||||
// This field IS NOT consulted in any way if "Allowed" is "true".
|
||||
// +optional
|
||||
status?: null | metav1.#Status @go(Result,*metav1.Status) @protobuf(3,bytes,opt)
|
||||
|
||||
// The patch body. Currently we only support "JSONPatch" which implements RFC 6902.
|
||||
// +optional
|
||||
patch?: bytes @go(Patch,[]byte) @protobuf(4,bytes,opt)
|
||||
|
||||
// The type of Patch. Currently we only allow "JSONPatch".
|
||||
// +optional
|
||||
patchType?: null | #PatchType @go(PatchType,*PatchType) @protobuf(5,bytes,opt)
|
||||
|
||||
// AuditAnnotations is an unstructured key value map set by remote admission controller (e.g. error=image-blacklisted).
|
||||
// MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controller will prefix the keys with
|
||||
// admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by
|
||||
// the admission webhook to add additional context to the audit log for this request.
|
||||
// +optional
|
||||
auditAnnotations?: {[string]: string} @go(AuditAnnotations,map[string]string) @protobuf(6,bytes,opt)
|
||||
|
||||
// warnings is a list of warning messages to return to the requesting API client.
|
||||
// Warning messages describe a problem the client making the API request should correct or be aware of.
|
||||
// Limit warnings to 120 characters if possible.
|
||||
// Warnings over 256 characters and large numbers of warnings may be truncated.
|
||||
// +optional
|
||||
warnings?: [...string] @go(Warnings,[]string) @protobuf(7,bytes,rep)
|
||||
}
|
||||
|
||||
// PatchType is the type of patch being used to represent the mutated object
|
||||
#PatchType: string // #enumPatchType
|
||||
|
||||
#enumPatchType:
|
||||
#PatchTypeJSONPatch
|
||||
|
||||
#PatchTypeJSONPatch: #PatchType & "JSONPatch"
|
||||
|
||||
// Operation is the type of resource operation being checked for admission control
|
||||
#Operation: string // #enumOperation
|
||||
|
||||
#enumOperation:
|
||||
#Create |
|
||||
#Update |
|
||||
#Delete |
|
||||
#Connect
|
||||
|
||||
#Create: #Operation & "CREATE"
|
||||
#Update: #Operation & "UPDATE"
|
||||
#Delete: #Operation & "DELETE"
|
||||
#Connect: #Operation & "CONNECT"
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admission/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
#GroupName: "admission.k8s.io"
|
||||
@@ -0,0 +1,172 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admission/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
authenticationv1 "k8s.io/api/authentication/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// AdmissionReview describes an admission review request/response.
|
||||
#AdmissionReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Request describes the attributes for the admission request.
|
||||
// +optional
|
||||
request?: null | #AdmissionRequest @go(Request,*AdmissionRequest) @protobuf(1,bytes,opt)
|
||||
|
||||
// Response describes the attributes for the admission response.
|
||||
// +optional
|
||||
response?: null | #AdmissionResponse @go(Response,*AdmissionResponse) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// AdmissionRequest describes the admission.Attributes for the admission request.
|
||||
#AdmissionRequest: {
|
||||
// UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
|
||||
// otherwise identical (parallel requests, requests when earlier requests did not modify etc)
|
||||
// The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.
|
||||
// It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
|
||||
uid: types.#UID @go(UID) @protobuf(1,bytes,opt)
|
||||
|
||||
// Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)
|
||||
kind: metav1.#GroupVersionKind @go(Kind) @protobuf(2,bytes,opt)
|
||||
|
||||
// Resource is the fully-qualified resource being requested (for example, v1.pods)
|
||||
resource: metav1.#GroupVersionResource @go(Resource) @protobuf(3,bytes,opt)
|
||||
|
||||
// SubResource is the subresource being requested, if any (for example, "status" or "scale")
|
||||
// +optional
|
||||
subResource?: string @go(SubResource) @protobuf(4,bytes,opt)
|
||||
|
||||
// RequestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale).
|
||||
// If this is specified and differs from the value in "kind", an equivalent match and conversion was performed.
|
||||
//
|
||||
// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
|
||||
// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
|
||||
// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
|
||||
// with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the rule the webhook registered for),
|
||||
// and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}` (indicating the kind of the original API request).
|
||||
//
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type for more details.
|
||||
// +optional
|
||||
requestKind?: null | metav1.#GroupVersionKind @go(RequestKind,*metav1.GroupVersionKind) @protobuf(13,bytes,opt)
|
||||
|
||||
// RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
|
||||
// If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
|
||||
//
|
||||
// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
|
||||
// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
|
||||
// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
|
||||
// with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
|
||||
// and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original API request).
|
||||
//
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type.
|
||||
// +optional
|
||||
requestResource?: null | metav1.#GroupVersionResource @go(RequestResource,*metav1.GroupVersionResource) @protobuf(14,bytes,opt)
|
||||
|
||||
// RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
|
||||
// If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
|
||||
// See documentation for the "matchPolicy" field in the webhook configuration type.
|
||||
// +optional
|
||||
requestSubResource?: string @go(RequestSubResource) @protobuf(15,bytes,opt)
|
||||
|
||||
// Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
|
||||
// rely on the server to generate the name. If that is the case, this field will contain an empty string.
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(5,bytes,opt)
|
||||
|
||||
// Namespace is the namespace associated with the request (if any).
|
||||
// +optional
|
||||
namespace?: string @go(Namespace) @protobuf(6,bytes,opt)
|
||||
|
||||
// Operation is the operation being performed. This may be different than the operation
|
||||
// requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
|
||||
operation: #Operation @go(Operation) @protobuf(7,bytes,opt)
|
||||
|
||||
// UserInfo is information about the requesting user
|
||||
userInfo: authenticationv1.#UserInfo @go(UserInfo) @protobuf(8,bytes,opt)
|
||||
|
||||
// Object is the object from the incoming request.
|
||||
// +optional
|
||||
object?: runtime.#RawExtension @go(Object) @protobuf(9,bytes,opt)
|
||||
|
||||
// OldObject is the existing object. Only populated for DELETE and UPDATE requests.
|
||||
// +optional
|
||||
oldObject?: runtime.#RawExtension @go(OldObject) @protobuf(10,bytes,opt)
|
||||
|
||||
// DryRun indicates that modifications will definitely not be persisted for this request.
|
||||
// Defaults to false.
|
||||
// +optional
|
||||
dryRun?: null | bool @go(DryRun,*bool) @protobuf(11,varint,opt)
|
||||
|
||||
// Options is the operation option structure of the operation being performed.
|
||||
// e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
|
||||
// different than the options the caller provided. e.g. for a patch request the performed
|
||||
// Operation might be a CREATE, in which case the Options will a
|
||||
// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
|
||||
// +optional
|
||||
options?: runtime.#RawExtension @go(Options) @protobuf(12,bytes,opt)
|
||||
}
|
||||
|
||||
// AdmissionResponse describes an admission response.
|
||||
#AdmissionResponse: {
|
||||
// UID is an identifier for the individual request/response.
|
||||
// This should be copied over from the corresponding AdmissionRequest.
|
||||
uid: types.#UID @go(UID) @protobuf(1,bytes,opt)
|
||||
|
||||
// Allowed indicates whether or not the admission request was permitted.
|
||||
allowed: bool @go(Allowed) @protobuf(2,varint,opt)
|
||||
|
||||
// Result contains extra details into why an admission request was denied.
|
||||
// This field IS NOT consulted in any way if "Allowed" is "true".
|
||||
// +optional
|
||||
status?: null | metav1.#Status @go(Result,*metav1.Status) @protobuf(3,bytes,opt)
|
||||
|
||||
// The patch body. Currently we only support "JSONPatch" which implements RFC 6902.
|
||||
// +optional
|
||||
patch?: bytes @go(Patch,[]byte) @protobuf(4,bytes,opt)
|
||||
|
||||
// The type of Patch. Currently we only allow "JSONPatch".
|
||||
// +optional
|
||||
patchType?: null | #PatchType @go(PatchType,*PatchType) @protobuf(5,bytes,opt)
|
||||
|
||||
// AuditAnnotations is an unstructured key value map set by remote admission controller (e.g. error=image-blacklisted).
|
||||
// MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controller will prefix the keys with
|
||||
// admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by
|
||||
// the admission webhook to add additional context to the audit log for this request.
|
||||
// +optional
|
||||
auditAnnotations?: {[string]: string} @go(AuditAnnotations,map[string]string) @protobuf(6,bytes,opt)
|
||||
|
||||
// warnings is a list of warning messages to return to the requesting API client.
|
||||
// Warning messages describe a problem the client making the API request should correct or be aware of.
|
||||
// Limit warnings to 120 characters if possible.
|
||||
// Warnings over 256 characters and large numbers of warnings may be truncated.
|
||||
// +optional
|
||||
warnings?: [...string] @go(Warnings,[]string) @protobuf(7,bytes,rep)
|
||||
}
|
||||
|
||||
// PatchType is the type of patch being used to represent the mutated object
|
||||
#PatchType: string // #enumPatchType
|
||||
|
||||
#enumPatchType:
|
||||
#PatchTypeJSONPatch
|
||||
|
||||
#PatchTypeJSONPatch: #PatchType & "JSONPatch"
|
||||
|
||||
// Operation is the type of resource operation being checked for admission control
|
||||
#Operation: string // #enumOperation
|
||||
|
||||
#enumOperation:
|
||||
#Create |
|
||||
#Update |
|
||||
#Delete |
|
||||
#Connect
|
||||
|
||||
#Create: #Operation & "CREATE"
|
||||
#Update: #Operation & "UPDATE"
|
||||
#Delete: #Operation & "DELETE"
|
||||
#Connect: #Operation & "CONNECT"
|
||||
@@ -0,0 +1,9 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1
|
||||
|
||||
// Package v1 is the v1 version of the API.
|
||||
// AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration
|
||||
// MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the
|
||||
// new dynamic admission controller configuration.
|
||||
package v1
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1
|
||||
|
||||
package v1
|
||||
|
||||
#GroupName: "admissionregistration.k8s.io"
|
||||
@@ -0,0 +1,645 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
|
||||
// to make sure that all the tuple expansions are valid.
|
||||
#Rule: {
|
||||
// APIGroups is the API groups the resources belong to. '*' is all groups.
|
||||
// If '*' is present, the length of the slice must be one.
|
||||
// Required.
|
||||
// +listType=atomic
|
||||
apiGroups?: [...string] @go(APIGroups,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// APIVersions is the API versions the resources belong to. '*' is all versions.
|
||||
// If '*' is present, the length of the slice must be one.
|
||||
// Required.
|
||||
// +listType=atomic
|
||||
apiVersions?: [...string] @go(APIVersions,[]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// Resources is a list of resources this rule applies to.
|
||||
//
|
||||
// For example:
|
||||
// 'pods' means pods.
|
||||
// 'pods/log' means the log subresource of pods.
|
||||
// '*' means all resources, but not subresources.
|
||||
// 'pods/*' means all subresources of pods.
|
||||
// '*/scale' means all scale subresources.
|
||||
// '*/*' means all resources and their subresources.
|
||||
//
|
||||
// If wildcard is present, the validation rule will ensure resources do not
|
||||
// overlap with each other.
|
||||
//
|
||||
// Depending on the enclosing object, subresources might not be allowed.
|
||||
// Required.
|
||||
// +listType=atomic
|
||||
resources?: [...string] @go(Resources,[]string) @protobuf(3,bytes,rep)
|
||||
|
||||
// scope specifies the scope of this rule.
|
||||
// Valid values are "Cluster", "Namespaced", and "*"
|
||||
// "Cluster" means that only cluster-scoped resources will match this rule.
|
||||
// Namespace API objects are cluster-scoped.
|
||||
// "Namespaced" means that only namespaced resources will match this rule.
|
||||
// "*" means that there are no scope restrictions.
|
||||
// Subresources match the scope of their parent resource.
|
||||
// Default is "*".
|
||||
//
|
||||
// +optional
|
||||
scope?: null | #ScopeType @go(Scope,*ScopeType) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// ScopeType specifies a scope for a Rule.
|
||||
// +enum
|
||||
#ScopeType: string // #enumScopeType
|
||||
|
||||
#enumScopeType:
|
||||
#ClusterScope |
|
||||
#NamespacedScope |
|
||||
#AllScopes
|
||||
|
||||
// ClusterScope means that scope is limited to cluster-scoped objects.
|
||||
// Namespace objects are cluster-scoped.
|
||||
#ClusterScope: #ScopeType & "Cluster"
|
||||
|
||||
// NamespacedScope means that scope is limited to namespaced objects.
|
||||
#NamespacedScope: #ScopeType & "Namespaced"
|
||||
|
||||
// AllScopes means that all scopes are included.
|
||||
#AllScopes: #ScopeType & "*"
|
||||
|
||||
// FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.
|
||||
// +enum
|
||||
#FailurePolicyType: string // #enumFailurePolicyType
|
||||
|
||||
#enumFailurePolicyType:
|
||||
#Ignore |
|
||||
#Fail
|
||||
|
||||
// Ignore means that an error calling the webhook is ignored.
|
||||
#Ignore: #FailurePolicyType & "Ignore"
|
||||
|
||||
// Fail means that an error calling the webhook causes the admission to fail.
|
||||
#Fail: #FailurePolicyType & "Fail"
|
||||
|
||||
// MatchPolicyType specifies the type of match policy.
|
||||
// +enum
|
||||
#MatchPolicyType: string // #enumMatchPolicyType
|
||||
|
||||
#enumMatchPolicyType:
|
||||
#Exact |
|
||||
#Equivalent
|
||||
|
||||
// Exact means requests should only be sent to the webhook if they exactly match a given rule.
|
||||
#Exact: #MatchPolicyType & "Exact"
|
||||
|
||||
// Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
|
||||
#Equivalent: #MatchPolicyType & "Equivalent"
|
||||
|
||||
// SideEffectClass specifies the types of side effects a webhook may have.
|
||||
// +enum
|
||||
#SideEffectClass: string // #enumSideEffectClass
|
||||
|
||||
#enumSideEffectClass:
|
||||
#SideEffectClassUnknown |
|
||||
#SideEffectClassNone |
|
||||
#SideEffectClassSome |
|
||||
#SideEffectClassNoneOnDryRun
|
||||
|
||||
// SideEffectClassUnknown means that no information is known about the side effects of calling the webhook.
|
||||
// If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
|
||||
#SideEffectClassUnknown: #SideEffectClass & "Unknown"
|
||||
|
||||
// SideEffectClassNone means that calling the webhook will have no side effects.
|
||||
#SideEffectClassNone: #SideEffectClass & "None"
|
||||
|
||||
// SideEffectClassSome means that calling the webhook will possibly have side effects.
|
||||
// If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
|
||||
#SideEffectClassSome: #SideEffectClass & "Some"
|
||||
|
||||
// SideEffectClassNoneOnDryRun means that calling the webhook will possibly have side effects, but if the
|
||||
// request being reviewed has the dry-run attribute, the side effects will be suppressed.
|
||||
#SideEffectClassNoneOnDryRun: #SideEffectClass & "NoneOnDryRun"
|
||||
|
||||
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
|
||||
#ValidatingWebhookConfiguration: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||
// +optional
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
webhooks?: [...#ValidatingWebhook] @go(Webhooks,[]ValidatingWebhook) @protobuf(2,bytes,rep,name=Webhooks)
|
||||
}
|
||||
|
||||
// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.
|
||||
#ValidatingWebhookConfigurationList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// List of ValidatingWebhookConfiguration.
|
||||
items: [...#ValidatingWebhookConfiguration] @go(Items,[]ValidatingWebhookConfiguration) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
|
||||
#MutatingWebhookConfiguration: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||
// +optional
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
webhooks?: [...#MutatingWebhook] @go(Webhooks,[]MutatingWebhook) @protobuf(2,bytes,rep,name=Webhooks)
|
||||
}
|
||||
|
||||
// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
|
||||
#MutatingWebhookConfigurationList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// List of MutatingWebhookConfiguration.
|
||||
items: [...#MutatingWebhookConfiguration] @go(Items,[]MutatingWebhookConfiguration) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||
#ValidatingWebhook: {
|
||||
// The name of the admission webhook.
|
||||
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||
// of the organization.
|
||||
// Required.
|
||||
name: string @go(Name) @protobuf(1,bytes,opt)
|
||||
|
||||
// ClientConfig defines how to communicate with the hook.
|
||||
// Required
|
||||
clientConfig: #WebhookClientConfig @go(ClientConfig) @protobuf(2,bytes,opt)
|
||||
|
||||
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||
// The webhook cares about an operation if it matches _any_ Rule.
|
||||
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||
// from putting the cluster in a state which cannot be recovered from without completely
|
||||
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||
rules?: [...#RuleWithOperations] @go(Rules,[]RuleWithOperations) @protobuf(3,bytes,rep)
|
||||
|
||||
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||
// +optional
|
||||
failurePolicy?: null | #FailurePolicyType @go(FailurePolicy,*FailurePolicyType) @protobuf(4,bytes,opt,casttype=FailurePolicyType)
|
||||
|
||||
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||
// Allowed values are "Exact" or "Equivalent".
|
||||
//
|
||||
// - Exact: match a request only if it exactly matches a specified rule.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||
//
|
||||
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||
//
|
||||
// Defaults to "Equivalent"
|
||||
// +optional
|
||||
matchPolicy?: null | #MatchPolicyType @go(MatchPolicy,*MatchPolicyType) @protobuf(9,bytes,opt,casttype=MatchPolicyType)
|
||||
|
||||
// NamespaceSelector decides whether to run the webhook on an object based
|
||||
// on whether the namespace for that object matches the selector. If the
|
||||
// object itself is a namespace, the matching is performed on
|
||||
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||
// it never skips the webhook.
|
||||
//
|
||||
// For example, to run the webhook on any objects whose namespace is not
|
||||
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||
// follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "runlevel",
|
||||
// "operator": "NotIn",
|
||||
// "values": [
|
||||
// "0",
|
||||
// "1"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// If instead you want to only run the webhook on any objects whose
|
||||
// namespace is associated with the "environment" of "prod" or "staging";
|
||||
// you will set the selector as follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "environment",
|
||||
// "operator": "In",
|
||||
// "values": [
|
||||
// "prod",
|
||||
// "staging"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// See
|
||||
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
|
||||
// for more examples of label selectors.
|
||||
//
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
namespaceSelector?: null | metav1.#LabelSelector @go(NamespaceSelector,*metav1.LabelSelector) @protobuf(5,bytes,opt)
|
||||
|
||||
// ObjectSelector decides whether to run the webhook based on if the
|
||||
// object has matching labels. objectSelector is evaluated against both
|
||||
// the oldObject and newObject that would be sent to the webhook, and
|
||||
// is considered to match if either object matches the selector. A null
|
||||
// object (oldObject in the case of create, or newObject in the case of
|
||||
// delete) or an object that cannot have labels (like a
|
||||
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||
// match.
|
||||
// Use the object selector only if the webhook is opt-in, because end
|
||||
// users may skip the admission webhook by setting the labels.
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
objectSelector?: null | metav1.#LabelSelector @go(ObjectSelector,*metav1.LabelSelector) @protobuf(10,bytes,opt)
|
||||
|
||||
// SideEffects states whether this webhook has side effects.
|
||||
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
|
||||
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
|
||||
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||
// sideEffects == Unknown or Some.
|
||||
sideEffects?: null | #SideEffectClass @go(SideEffects,*SideEffectClass) @protobuf(6,bytes,opt,casttype=SideEffectClass)
|
||||
|
||||
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||
// the webhook call will be ignored or the API call will fail based on the
|
||||
// failure policy.
|
||||
// The timeout value must be between 1 and 30 seconds.
|
||||
// Default to 10 seconds.
|
||||
// +optional
|
||||
timeoutSeconds?: null | int32 @go(TimeoutSeconds,*int32) @protobuf(7,varint,opt)
|
||||
|
||||
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||
// versions the Webhook expects. API server will try to use first version in
|
||||
// the list which it supports. If none of the versions specified in this list
|
||||
// supported by API server, validation will fail for this object.
|
||||
// If a persisted webhook configuration specifies allowed versions and does not
|
||||
// include any versions known to the API Server, calls to the webhook will fail
|
||||
// and be subject to the failure policy.
|
||||
admissionReviewVersions: [...string] @go(AdmissionReviewVersions,[]string) @protobuf(8,bytes,rep)
|
||||
|
||||
// MatchConditions is a list of conditions that must be met for a request to be sent to this
|
||||
// webhook. Match conditions filter requests that have already been matched by the rules,
|
||||
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
|
||||
// There are a maximum of 64 match conditions allowed.
|
||||
//
|
||||
// The exact matching logic is (in order):
|
||||
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
|
||||
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
|
||||
// 3. If any matchCondition evaluates to an error (but none are FALSE):
|
||||
// - If failurePolicy=Fail, reject the request
|
||||
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
|
||||
//
|
||||
// This is a beta feature and managed by the AdmissionWebhookMatchConditions feature gate.
|
||||
//
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +listType=map
|
||||
// +listMapKey=name
|
||||
// +featureGate=AdmissionWebhookMatchConditions
|
||||
// +optional
|
||||
matchConditions?: [...#MatchCondition] @go(MatchConditions,[]MatchCondition) @protobuf(11,bytes,opt)
|
||||
}
|
||||
|
||||
// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||
#MutatingWebhook: {
|
||||
// The name of the admission webhook.
|
||||
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||
// of the organization.
|
||||
// Required.
|
||||
name: string @go(Name) @protobuf(1,bytes,opt)
|
||||
|
||||
// ClientConfig defines how to communicate with the hook.
|
||||
// Required
|
||||
clientConfig: #WebhookClientConfig @go(ClientConfig) @protobuf(2,bytes,opt)
|
||||
|
||||
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||
// The webhook cares about an operation if it matches _any_ Rule.
|
||||
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||
// from putting the cluster in a state which cannot be recovered from without completely
|
||||
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||
rules?: [...#RuleWithOperations] @go(Rules,[]RuleWithOperations) @protobuf(3,bytes,rep)
|
||||
|
||||
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||
// +optional
|
||||
failurePolicy?: null | #FailurePolicyType @go(FailurePolicy,*FailurePolicyType) @protobuf(4,bytes,opt,casttype=FailurePolicyType)
|
||||
|
||||
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||
// Allowed values are "Exact" or "Equivalent".
|
||||
//
|
||||
// - Exact: match a request only if it exactly matches a specified rule.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||
//
|
||||
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||
//
|
||||
// Defaults to "Equivalent"
|
||||
// +optional
|
||||
matchPolicy?: null | #MatchPolicyType @go(MatchPolicy,*MatchPolicyType) @protobuf(9,bytes,opt,casttype=MatchPolicyType)
|
||||
|
||||
// NamespaceSelector decides whether to run the webhook on an object based
|
||||
// on whether the namespace for that object matches the selector. If the
|
||||
// object itself is a namespace, the matching is performed on
|
||||
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||
// it never skips the webhook.
|
||||
//
|
||||
// For example, to run the webhook on any objects whose namespace is not
|
||||
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||
// follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "runlevel",
|
||||
// "operator": "NotIn",
|
||||
// "values": [
|
||||
// "0",
|
||||
// "1"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// If instead you want to only run the webhook on any objects whose
|
||||
// namespace is associated with the "environment" of "prod" or "staging";
|
||||
// you will set the selector as follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "environment",
|
||||
// "operator": "In",
|
||||
// "values": [
|
||||
// "prod",
|
||||
// "staging"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// See
|
||||
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
// for more examples of label selectors.
|
||||
//
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
namespaceSelector?: null | metav1.#LabelSelector @go(NamespaceSelector,*metav1.LabelSelector) @protobuf(5,bytes,opt)
|
||||
|
||||
// ObjectSelector decides whether to run the webhook based on if the
|
||||
// object has matching labels. objectSelector is evaluated against both
|
||||
// the oldObject and newObject that would be sent to the webhook, and
|
||||
// is considered to match if either object matches the selector. A null
|
||||
// object (oldObject in the case of create, or newObject in the case of
|
||||
// delete) or an object that cannot have labels (like a
|
||||
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||
// match.
|
||||
// Use the object selector only if the webhook is opt-in, because end
|
||||
// users may skip the admission webhook by setting the labels.
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
objectSelector?: null | metav1.#LabelSelector @go(ObjectSelector,*metav1.LabelSelector) @protobuf(11,bytes,opt)
|
||||
|
||||
// SideEffects states whether this webhook has side effects.
|
||||
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
|
||||
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
|
||||
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||
// sideEffects == Unknown or Some.
|
||||
sideEffects?: null | #SideEffectClass @go(SideEffects,*SideEffectClass) @protobuf(6,bytes,opt,casttype=SideEffectClass)
|
||||
|
||||
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||
// the webhook call will be ignored or the API call will fail based on the
|
||||
// failure policy.
|
||||
// The timeout value must be between 1 and 30 seconds.
|
||||
// Default to 10 seconds.
|
||||
// +optional
|
||||
timeoutSeconds?: null | int32 @go(TimeoutSeconds,*int32) @protobuf(7,varint,opt)
|
||||
|
||||
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||
// versions the Webhook expects. API server will try to use first version in
|
||||
// the list which it supports. If none of the versions specified in this list
|
||||
// supported by API server, validation will fail for this object.
|
||||
// If a persisted webhook configuration specifies allowed versions and does not
|
||||
// include any versions known to the API Server, calls to the webhook will fail
|
||||
// and be subject to the failure policy.
|
||||
admissionReviewVersions: [...string] @go(AdmissionReviewVersions,[]string) @protobuf(8,bytes,rep)
|
||||
|
||||
// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
|
||||
// Allowed values are "Never" and "IfNeeded".
|
||||
//
|
||||
// Never: the webhook will not be called more than once in a single admission evaluation.
|
||||
//
|
||||
// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
|
||||
// if the object being admitted is modified by other admission plugins after the initial webhook call.
|
||||
// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
|
||||
// Note:
|
||||
// * the number of additional invocations is not guaranteed to be exactly one.
|
||||
// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
|
||||
// * webhooks that use this option may be reordered to minimize the number of additional invocations.
|
||||
// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
|
||||
//
|
||||
// Defaults to "Never".
|
||||
// +optional
|
||||
reinvocationPolicy?: null | #ReinvocationPolicyType @go(ReinvocationPolicy,*ReinvocationPolicyType) @protobuf(10,bytes,opt,casttype=ReinvocationPolicyType)
|
||||
|
||||
// MatchConditions is a list of conditions that must be met for a request to be sent to this
|
||||
// webhook. Match conditions filter requests that have already been matched by the rules,
|
||||
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
|
||||
// There are a maximum of 64 match conditions allowed.
|
||||
//
|
||||
// The exact matching logic is (in order):
|
||||
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
|
||||
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
|
||||
// 3. If any matchCondition evaluates to an error (but none are FALSE):
|
||||
// - If failurePolicy=Fail, reject the request
|
||||
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
|
||||
//
|
||||
// This is a beta feature and managed by the AdmissionWebhookMatchConditions feature gate.
|
||||
//
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +listType=map
|
||||
// +listMapKey=name
|
||||
// +featureGate=AdmissionWebhookMatchConditions
|
||||
// +optional
|
||||
matchConditions?: [...#MatchCondition] @go(MatchConditions,[]MatchCondition) @protobuf(12,bytes,opt)
|
||||
}
|
||||
|
||||
// ReinvocationPolicyType specifies what type of policy the admission hook uses.
|
||||
// +enum
|
||||
#ReinvocationPolicyType: string // #enumReinvocationPolicyType
|
||||
|
||||
#enumReinvocationPolicyType:
|
||||
#NeverReinvocationPolicy |
|
||||
#IfNeededReinvocationPolicy
|
||||
|
||||
// NeverReinvocationPolicy indicates that the webhook must not be called more than once in a
|
||||
// single admission evaluation.
|
||||
#NeverReinvocationPolicy: #ReinvocationPolicyType & "Never"
|
||||
|
||||
// IfNeededReinvocationPolicy indicates that the webhook may be called at least one
|
||||
// additional time as part of the admission evaluation if the object being admitted is
|
||||
// modified by other admission plugins after the initial webhook call.
|
||||
#IfNeededReinvocationPolicy: #ReinvocationPolicyType & "IfNeeded"
|
||||
|
||||
// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
|
||||
// sure that all the tuple expansions are valid.
|
||||
#RuleWithOperations: {
|
||||
// Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or *
|
||||
// for all of those operations and any future admission operations that are added.
|
||||
// If '*' is present, the length of the slice must be one.
|
||||
// Required.
|
||||
// +listType=atomic
|
||||
operations?: [...#OperationType] @go(Operations,[]OperationType) @protobuf(1,bytes,rep,casttype=OperationType)
|
||||
|
||||
#Rule
|
||||
}
|
||||
|
||||
// OperationType specifies an operation for a request.
|
||||
// +enum
|
||||
#OperationType: string // #enumOperationType
|
||||
|
||||
#enumOperationType:
|
||||
#OperationAll |
|
||||
#Create |
|
||||
#Update |
|
||||
#Delete |
|
||||
#Connect
|
||||
|
||||
#OperationAll: #OperationType & "*"
|
||||
#Create: #OperationType & "CREATE"
|
||||
#Update: #OperationType & "UPDATE"
|
||||
#Delete: #OperationType & "DELETE"
|
||||
#Connect: #OperationType & "CONNECT"
|
||||
|
||||
// WebhookClientConfig contains the information to make a TLS
|
||||
// connection with the webhook
|
||||
#WebhookClientConfig: {
|
||||
// `url` gives the location of the webhook, in standard URL form
|
||||
// (`scheme://host:port/path`). Exactly one of `url` or `service`
|
||||
// must be specified.
|
||||
//
|
||||
// The `host` should not refer to a service running in the cluster; use
|
||||
// the `service` field instead. The host might be resolved via external
|
||||
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
|
||||
// in-cluster DNS as that would be a layering violation). `host` may
|
||||
// also be an IP address.
|
||||
//
|
||||
// Please note that using `localhost` or `127.0.0.1` as a `host` is
|
||||
// risky unless you take great care to run this webhook on all hosts
|
||||
// which run an apiserver which might need to make calls to this
|
||||
// webhook. Such installs are likely to be non-portable, i.e., not easy
|
||||
// to turn up in a new cluster.
|
||||
//
|
||||
// The scheme must be "https"; the URL must begin with "https://".
|
||||
//
|
||||
// A path is optional, and if present may be any string permissible in
|
||||
// a URL. You may use the path to pass an arbitrary string to the
|
||||
// webhook, for example, a cluster identifier.
|
||||
//
|
||||
// Attempting to use a user or basic auth e.g. "user:password@" is not
|
||||
// allowed. Fragments ("#...") and query parameters ("?...") are not
|
||||
// allowed, either.
|
||||
//
|
||||
// +optional
|
||||
url?: null | string @go(URL,*string) @protobuf(3,bytes,opt)
|
||||
|
||||
// `service` is a reference to the service for this webhook. Either
|
||||
// `service` or `url` must be specified.
|
||||
//
|
||||
// If the webhook is running within the cluster, then you should use `service`.
|
||||
//
|
||||
// +optional
|
||||
service?: null | #ServiceReference @go(Service,*ServiceReference) @protobuf(1,bytes,opt)
|
||||
|
||||
// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
|
||||
// If unspecified, system trust roots on the apiserver are used.
|
||||
// +optional
|
||||
caBundle?: bytes @go(CABundle,[]byte) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// ServiceReference holds a reference to Service.legacy.k8s.io
|
||||
#ServiceReference: {
|
||||
// `namespace` is the namespace of the service.
|
||||
// Required
|
||||
namespace: string @go(Namespace) @protobuf(1,bytes,opt)
|
||||
|
||||
// `name` is the name of the service.
|
||||
// Required
|
||||
name: string @go(Name) @protobuf(2,bytes,opt)
|
||||
|
||||
// `path` is an optional URL path which will be sent in any request to
|
||||
// this service.
|
||||
// +optional
|
||||
path?: null | string @go(Path,*string) @protobuf(3,bytes,opt)
|
||||
|
||||
// If specified, the port on the service that hosting webhook.
|
||||
// Default to 443 for backward compatibility.
|
||||
// `port` should be a valid port number (1-65535, inclusive).
|
||||
// +optional
|
||||
port?: null | int32 @go(Port,*int32) @protobuf(4,varint,opt)
|
||||
}
|
||||
|
||||
// MatchCondition represents a condition which must by fulfilled for a request to be sent to a webhook.
|
||||
#MatchCondition: {
|
||||
// Name is an identifier for this match condition, used for strategic merging of MatchConditions,
|
||||
// as well as providing an identifier for logging purposes. A good name should be descriptive of
|
||||
// the associated expression.
|
||||
// Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
|
||||
// must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
|
||||
// '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
|
||||
// optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
|
||||
//
|
||||
// Required.
|
||||
name: string @go(Name) @protobuf(1,bytes,opt)
|
||||
|
||||
// Expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
|
||||
// CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
|
||||
//
|
||||
// 'object' - The object from the incoming request. The value is null for DELETE requests.
|
||||
// 'oldObject' - The existing object. The value is null for CREATE requests.
|
||||
// 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
|
||||
// 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
||||
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
||||
// 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
||||
// request resource.
|
||||
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
|
||||
//
|
||||
// Required.
|
||||
expression: string @go(Expression) @protobuf(2,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1alpha1
|
||||
|
||||
// Package v1alpha1 is the v1alpha1 version of the API.
|
||||
package v1alpha1
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#GroupName: "admissionregistration.k8s.io"
|
||||
@@ -0,0 +1,679 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
|
||||
// to make sure that all the tuple expansions are valid.
|
||||
#Rule: v1.#Rule
|
||||
|
||||
// ScopeType specifies a scope for a Rule.
|
||||
// +enum
|
||||
#ScopeType: v1.#ScopeType // #enumScopeType
|
||||
|
||||
#enumScopeType:
|
||||
#ClusterScope |
|
||||
#NamespacedScope |
|
||||
#AllScopes
|
||||
|
||||
// ClusterScope means that scope is limited to cluster-scoped objects.
|
||||
// Namespace objects are cluster-scoped.
|
||||
#ClusterScope: v1.#ScopeType & "Cluster"
|
||||
|
||||
// NamespacedScope means that scope is limited to namespaced objects.
|
||||
#NamespacedScope: v1.#ScopeType & "Namespaced"
|
||||
|
||||
// AllScopes means that all scopes are included.
|
||||
#AllScopes: v1.#ScopeType & "*"
|
||||
|
||||
// ParameterNotFoundActionType specifies a failure policy that defines how a binding
|
||||
// is evaluated when the param referred by its perNamespaceParamRef is not found.
|
||||
// +enum
|
||||
#ParameterNotFoundActionType: string // #enumParameterNotFoundActionType
|
||||
|
||||
#enumParameterNotFoundActionType:
|
||||
#AllowAction |
|
||||
#DenyAction
|
||||
|
||||
// Ignore means that an error finding params for a binding is ignored
|
||||
#AllowAction: #ParameterNotFoundActionType & "Allow"
|
||||
|
||||
// Fail means that an error finding params for a binding is ignored
|
||||
#DenyAction: #ParameterNotFoundActionType & "Deny"
|
||||
|
||||
// FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.
|
||||
// +enum
|
||||
#FailurePolicyType: string // #enumFailurePolicyType
|
||||
|
||||
#enumFailurePolicyType:
|
||||
#Ignore |
|
||||
#Fail
|
||||
|
||||
// Ignore means that an error calling the webhook is ignored.
|
||||
#Ignore: #FailurePolicyType & "Ignore"
|
||||
|
||||
// Fail means that an error calling the webhook causes the admission to fail.
|
||||
#Fail: #FailurePolicyType & "Fail"
|
||||
|
||||
// MatchPolicyType specifies the type of match policy.
|
||||
// +enum
|
||||
#MatchPolicyType: string // #enumMatchPolicyType
|
||||
|
||||
#enumMatchPolicyType:
|
||||
#Exact |
|
||||
#Equivalent
|
||||
|
||||
// Exact means requests should only be sent to the webhook if they exactly match a given rule.
|
||||
#Exact: #MatchPolicyType & "Exact"
|
||||
|
||||
// Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
|
||||
#Equivalent: #MatchPolicyType & "Equivalent"
|
||||
|
||||
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
|
||||
#ValidatingAdmissionPolicy: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
|
||||
spec?: #ValidatingAdmissionPolicySpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// The status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy
|
||||
// behaves in the expected way.
|
||||
// Populated by the system.
|
||||
// Read-only.
|
||||
// +optional
|
||||
status?: #ValidatingAdmissionPolicyStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyStatus represents the status of a ValidatingAdmissionPolicy.
|
||||
#ValidatingAdmissionPolicyStatus: {
|
||||
// The generation observed by the controller.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(1,varint,opt)
|
||||
|
||||
// The results of type checking for each expression.
|
||||
// Presence of this field indicates the completion of the type checking.
|
||||
// +optional
|
||||
typeChecking?: null | #TypeChecking @go(TypeChecking,*TypeChecking) @protobuf(2,bytes,opt)
|
||||
|
||||
// The conditions represent the latest available observations of a policy's current state.
|
||||
// +optional
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
conditions?: [...metav1.#Condition] @go(Conditions,[]metav1.Condition) @protobuf(3,bytes,rep)
|
||||
}
|
||||
|
||||
// TypeChecking contains results of type checking the expressions in the
|
||||
// ValidatingAdmissionPolicy
|
||||
#TypeChecking: {
|
||||
// The type checking warnings for each expression.
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
expressionWarnings?: [...#ExpressionWarning] @go(ExpressionWarnings,[]ExpressionWarning) @protobuf(1,bytes,rep)
|
||||
}
|
||||
|
||||
// ExpressionWarning is a warning information that targets a specific expression.
|
||||
#ExpressionWarning: {
|
||||
// The path to the field that refers the expression.
|
||||
// For example, the reference to the expression of the first item of
|
||||
// validations is "spec.validations[0].expression"
|
||||
fieldRef: string @go(FieldRef) @protobuf(2,bytes,opt)
|
||||
|
||||
// The content of type checking information in a human-readable form.
|
||||
// Each line of the warning contains the type that the expression is checked
|
||||
// against, followed by the type check error from the compiler.
|
||||
warning: string @go(Warning) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.
|
||||
#ValidatingAdmissionPolicyList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// List of ValidatingAdmissionPolicy.
|
||||
items?: [...#ValidatingAdmissionPolicy] @go(Items,[]ValidatingAdmissionPolicy) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
|
||||
#ValidatingAdmissionPolicySpec: {
|
||||
// ParamKind specifies the kind of resources used to parameterize this policy.
|
||||
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
|
||||
// If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
|
||||
// If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
|
||||
// +optional
|
||||
paramKind?: null | #ParamKind @go(ParamKind,*ParamKind) @protobuf(1,bytes,rep)
|
||||
|
||||
// MatchConstraints specifies what resources this policy is designed to validate.
|
||||
// The AdmissionPolicy cares about a request if it matches _all_ Constraints.
|
||||
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
|
||||
// ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding.
|
||||
// Required.
|
||||
matchConstraints?: null | #MatchResources @go(MatchConstraints,*MatchResources) @protobuf(2,bytes,rep)
|
||||
|
||||
// Validations contain CEL expressions which is used to apply the validation.
|
||||
// Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is
|
||||
// required.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
validations?: [...#Validation] @go(Validations,[]Validation) @protobuf(3,bytes,rep)
|
||||
|
||||
// failurePolicy defines how to handle failures for the admission policy. Failures can
|
||||
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
|
||||
// or mis-configured policy definitions or bindings.
|
||||
//
|
||||
// A policy is invalid if spec.paramKind refers to a non-existent Kind.
|
||||
// A binding is invalid if spec.paramRef.name refers to a non-existent resource.
|
||||
//
|
||||
// failurePolicy does not define how validations that evaluate to false are handled.
|
||||
//
|
||||
// When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions
|
||||
// define how failures are enforced.
|
||||
//
|
||||
// Allowed values are Ignore or Fail. Defaults to Fail.
|
||||
// +optional
|
||||
failurePolicy?: null | #FailurePolicyType @go(FailurePolicy,*FailurePolicyType) @protobuf(4,bytes,opt,casttype=FailurePolicyType)
|
||||
|
||||
// auditAnnotations contains CEL expressions which are used to produce audit
|
||||
// annotations for the audit event of the API request.
|
||||
// validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is
|
||||
// required.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
auditAnnotations?: [...#AuditAnnotation] @go(AuditAnnotations,[]AuditAnnotation) @protobuf(5,bytes,rep)
|
||||
|
||||
// MatchConditions is a list of conditions that must be met for a request to be validated.
|
||||
// Match conditions filter requests that have already been matched by the rules,
|
||||
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
|
||||
// There are a maximum of 64 match conditions allowed.
|
||||
//
|
||||
// If a parameter object is provided, it can be accessed via the `params` handle in the same
|
||||
// manner as validation expressions.
|
||||
//
|
||||
// The exact matching logic is (in order):
|
||||
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
||||
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
||||
// 3. If any matchCondition evaluates to an error (but none are FALSE):
|
||||
// - If failurePolicy=Fail, reject the request
|
||||
// - If failurePolicy=Ignore, the policy is skipped
|
||||
//
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +listType=map
|
||||
// +listMapKey=name
|
||||
// +optional
|
||||
matchConditions?: [...#MatchCondition] @go(MatchConditions,[]MatchCondition) @protobuf(6,bytes,rep)
|
||||
|
||||
// Variables contain definitions of variables that can be used in composition of other expressions.
|
||||
// Each variable is defined as a named CEL expression.
|
||||
// The variables defined here will be available under `variables` in other expressions of the policy
|
||||
// except MatchConditions because MatchConditions are evaluated before the rest of the policy.
|
||||
//
|
||||
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
|
||||
// Thus, Variables must be sorted by the order of first appearance and acyclic.
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +listType=map
|
||||
// +listMapKey=name
|
||||
// +optional
|
||||
variables?: [...#Variable] @go(Variables,[]Variable) @protobuf(7,bytes,rep)
|
||||
}
|
||||
|
||||
#MatchCondition: v1.#MatchCondition
|
||||
|
||||
// ParamKind is a tuple of Group Kind and Version.
|
||||
// +structType=atomic
|
||||
#ParamKind: {
|
||||
// APIVersion is the API group version the resources belong to.
|
||||
// In format of "group/version".
|
||||
// Required.
|
||||
apiVersion?: string @go(APIVersion) @protobuf(1,bytes,rep)
|
||||
|
||||
// Kind is the API kind the resources belong to.
|
||||
// Required.
|
||||
kind?: string @go(Kind) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// Validation specifies the CEL expression which is used to apply the validation.
|
||||
#Validation: {
|
||||
// Expression represents the expression which will be evaluated by CEL.
|
||||
// ref: https://github.com/google/cel-spec
|
||||
// CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
|
||||
//
|
||||
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
|
||||
// - 'oldObject' - The existing object. The value is null for CREATE requests.
|
||||
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
|
||||
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
||||
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
|
||||
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
||||
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
||||
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
||||
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
||||
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
||||
// request resource.
|
||||
//
|
||||
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
|
||||
// object. No other metadata properties are accessible.
|
||||
//
|
||||
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
|
||||
// Accessible property names are escaped according to the following rules when accessed in the expression:
|
||||
// - '__' escapes to '__underscores__'
|
||||
// - '.' escapes to '__dot__'
|
||||
// - '-' escapes to '__dash__'
|
||||
// - '/' escapes to '__slash__'
|
||||
// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
|
||||
// "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
|
||||
// "import", "let", "loop", "package", "namespace", "return".
|
||||
// Examples:
|
||||
// - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
|
||||
// - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
|
||||
// - Expression accessing a property named "redact__d": {"Expression": "object.redact__underscores__d > 0"}
|
||||
//
|
||||
// Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
|
||||
// Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
|
||||
// - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and
|
||||
// non-intersecting elements in `Y` are appended, retaining their partial order.
|
||||
// - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values
|
||||
// are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
|
||||
// non-intersecting keys are appended, retaining their partial order.
|
||||
// Required.
|
||||
expression: string @go(Expression) @protobuf(1,bytes,opt,name=Expression)
|
||||
|
||||
// Message represents the message displayed when validation fails. The message is required if the Expression contains
|
||||
// line breaks. The message must not contain line breaks.
|
||||
// If unset, the message is "failed rule: {Rule}".
|
||||
// e.g. "must be a URL with the host matching spec.host"
|
||||
// If the Expression contains line breaks. Message is required.
|
||||
// The message must not contain line breaks.
|
||||
// If unset, the message is "failed Expression: {Expression}".
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(2,bytes,opt)
|
||||
|
||||
// Reason represents a machine-readable description of why this validation failed.
|
||||
// If this is the first validation in the list to fail, this reason, as well as the
|
||||
// corresponding HTTP response code, are used in the
|
||||
// HTTP response to the client.
|
||||
// The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid", "RequestEntityTooLarge".
|
||||
// If not set, StatusReasonInvalid is used in the response to the client.
|
||||
// +optional
|
||||
reason?: null | metav1.#StatusReason @go(Reason,*metav1.StatusReason) @protobuf(3,bytes,opt)
|
||||
|
||||
// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
|
||||
// Since messageExpression is used as a failure message, it must evaluate to a string.
|
||||
// If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails.
|
||||
// If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced
|
||||
// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
|
||||
// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and
|
||||
// the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged.
|
||||
// messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'.
|
||||
// Example:
|
||||
// "object.x must be less than max ("+string(params.max)+")"
|
||||
// +optional
|
||||
messageExpression?: string @go(MessageExpression) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// Variable is the definition of a variable that is used for composition.
|
||||
#Variable: {
|
||||
// Name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
|
||||
// The variable can be accessed in other expressions through `variables`
|
||||
// For example, if name is "foo", the variable will be available as `variables.foo`
|
||||
name: string @go(Name) @protobuf(1,bytes,opt,name=Name)
|
||||
|
||||
// Expression is the expression that will be evaluated as the value of the variable.
|
||||
// The CEL expression has access to the same identifiers as the CEL expressions in Validation.
|
||||
expression: string @go(Expression) @protobuf(2,bytes,opt,name=Expression)
|
||||
}
|
||||
|
||||
// AuditAnnotation describes how to produce an audit annotation for an API request.
|
||||
#AuditAnnotation: {
|
||||
// key specifies the audit annotation key. The audit annotation keys of
|
||||
// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
|
||||
// name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
|
||||
//
|
||||
// The key is combined with the resource name of the
|
||||
// ValidatingAdmissionPolicy to construct an audit annotation key:
|
||||
// "{ValidatingAdmissionPolicy name}/{key}".
|
||||
//
|
||||
// If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
|
||||
// and the same audit annotation key, the annotation key will be identical.
|
||||
// In this case, the first annotation written with the key will be included
|
||||
// in the audit event and all subsequent annotations with the same key
|
||||
// will be discarded.
|
||||
//
|
||||
// Required.
|
||||
key: string @go(Key) @protobuf(1,bytes,opt)
|
||||
|
||||
// valueExpression represents the expression which is evaluated by CEL to
|
||||
// produce an audit annotation value. The expression must evaluate to either
|
||||
// a string or null value. If the expression evaluates to a string, the
|
||||
// audit annotation is included with the string value. If the expression
|
||||
// evaluates to null or empty string the audit annotation will be omitted.
|
||||
// The valueExpression may be no longer than 5kb in length.
|
||||
// If the result of the valueExpression is more than 10kb in length, it
|
||||
// will be truncated to 10kb.
|
||||
//
|
||||
// If multiple ValidatingAdmissionPolicyBinding resources match an
|
||||
// API request, then the valueExpression will be evaluated for
|
||||
// each binding. All unique values produced by the valueExpressions
|
||||
// will be joined together in a comma-separated list.
|
||||
//
|
||||
// Required.
|
||||
valueExpression: string @go(ValueExpression) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources.
|
||||
// ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
|
||||
//
|
||||
// For a given admission request, each binding will cause its policy to be
|
||||
// evaluated N times, where N is 1 for policies/bindings that don't use
|
||||
// params, otherwise N is the number of parameters selected by the binding.
|
||||
//
|
||||
// The CEL expressions of a policy must have a computed CEL cost below the maximum
|
||||
// CEL budget. Each evaluation of the policy is given an independent CEL cost budget.
|
||||
// Adding/removing policies, bindings, or params can not affect whether a
|
||||
// given (policy, binding, param) combination is within its own CEL budget.
|
||||
#ValidatingAdmissionPolicyBinding: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
|
||||
spec?: #ValidatingAdmissionPolicyBindingSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding.
|
||||
#ValidatingAdmissionPolicyBindingList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// List of PolicyBinding.
|
||||
items?: [...#ValidatingAdmissionPolicyBinding] @go(Items,[]ValidatingAdmissionPolicyBinding) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
|
||||
#ValidatingAdmissionPolicyBindingSpec: {
|
||||
// PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to.
|
||||
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
|
||||
// Required.
|
||||
policyName?: string @go(PolicyName) @protobuf(1,bytes,rep)
|
||||
|
||||
// paramRef specifies the parameter resource used to configure the admission control policy.
|
||||
// It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy.
|
||||
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
|
||||
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
||||
// +optional
|
||||
paramRef?: null | #ParamRef @go(ParamRef,*ParamRef) @protobuf(2,bytes,rep)
|
||||
|
||||
// MatchResources declares what resources match this binding and will be validated by it.
|
||||
// Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this.
|
||||
// If this is unset, all resources matched by the policy are validated by this binding
|
||||
// When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated.
|
||||
// Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
|
||||
// +optional
|
||||
matchResources?: null | #MatchResources @go(MatchResources,*MatchResources) @protobuf(3,bytes,rep)
|
||||
|
||||
// validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced.
|
||||
// If a validation evaluates to false it is always enforced according to these actions.
|
||||
//
|
||||
// Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according
|
||||
// to these actions only if the FailurePolicy is set to Fail, otherwise the failures are
|
||||
// ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.
|
||||
//
|
||||
// validationActions is declared as a set of action values. Order does
|
||||
// not matter. validationActions may not contain duplicates of the same action.
|
||||
//
|
||||
// The supported actions values are:
|
||||
//
|
||||
// "Deny" specifies that a validation failure results in a denied request.
|
||||
//
|
||||
// "Warn" specifies that a validation failure is reported to the request client
|
||||
// in HTTP Warning headers, with a warning code of 299. Warnings can be sent
|
||||
// both for allowed or denied admission responses.
|
||||
//
|
||||
// "Audit" specifies that a validation failure is included in the published
|
||||
// audit event for the request. The audit event will contain a
|
||||
// `validation.policy.admission.k8s.io/validation_failure` audit annotation
|
||||
// with a value containing the details of the validation failures, formatted as
|
||||
// a JSON list of objects, each with the following fields:
|
||||
// - message: The validation failure message string
|
||||
// - policy: The resource name of the ValidatingAdmissionPolicy
|
||||
// - binding: The resource name of the ValidatingAdmissionPolicyBinding
|
||||
// - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy
|
||||
// - validationActions: The enforcement actions enacted for the validation failure
|
||||
// Example audit annotation:
|
||||
// `"validation.policy.admission.k8s.io/validation_failure": "[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]"`
|
||||
//
|
||||
// Clients should expect to handle additional values by ignoring
|
||||
// any values not recognized.
|
||||
//
|
||||
// "Deny" and "Warn" may not be used together since this combination
|
||||
// needlessly duplicates the validation failure both in the
|
||||
// API response body and the HTTP warning headers.
|
||||
//
|
||||
// Required.
|
||||
// +listType=set
|
||||
validationActions?: [...#ValidationAction] @go(ValidationActions,[]ValidationAction) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// ParamRef describes how to locate the params to be used as input to
|
||||
// expressions of rules applied by a policy binding.
|
||||
// +structType=atomic
|
||||
#ParamRef: {
|
||||
// `name` is the name of the resource being referenced.
|
||||
//
|
||||
// `name` and `selector` are mutually exclusive properties. If one is set,
|
||||
// the other must be unset.
|
||||
//
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(1,bytes,rep)
|
||||
|
||||
// namespace is the namespace of the referenced resource. Allows limiting
|
||||
// the search for params to a specific namespace. Applies to both `name` and
|
||||
// `selector` fields.
|
||||
//
|
||||
// A per-namespace parameter may be used by specifying a namespace-scoped
|
||||
// `paramKind` in the policy and leaving this field empty.
|
||||
//
|
||||
// - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
|
||||
// field results in a configuration error.
|
||||
//
|
||||
// - If `paramKind` is namespace-scoped, the namespace of the object being
|
||||
// evaluated for admission will be used when this field is left unset. Take
|
||||
// care that if this is left empty the binding must not match any cluster-scoped
|
||||
// resources, which will result in an error.
|
||||
//
|
||||
// +optional
|
||||
namespace?: string @go(Namespace) @protobuf(2,bytes,rep)
|
||||
|
||||
// selector can be used to match multiple param objects based on their labels.
|
||||
// Supply selector: {} to match all resources of the ParamKind.
|
||||
//
|
||||
// If multiple params are found, they are all evaluated with the policy expressions
|
||||
// and the results are ANDed together.
|
||||
//
|
||||
// One of `name` or `selector` must be set, but `name` and `selector` are
|
||||
// mutually exclusive properties. If one is set, the other must be unset.
|
||||
//
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(3,bytes,rep)
|
||||
|
||||
// `parameterNotFoundAction` controls the behavior of the binding when the resource
|
||||
// exists, and name or selector is valid, but there are no parameters
|
||||
// matched by the binding. If the value is set to `Allow`, then no
|
||||
// matched parameters will be treated as successful validation by the binding.
|
||||
// If set to `Deny`, then no matched parameters will be subject to the
|
||||
// `failurePolicy` of the policy.
|
||||
//
|
||||
// Allowed values are `Allow` or `Deny`
|
||||
// Default to `Deny`
|
||||
// +optional
|
||||
parameterNotFoundAction?: null | #ParameterNotFoundActionType @go(ParameterNotFoundAction,*ParameterNotFoundActionType) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// MatchResources decides whether to run the admission control policy on an object based
|
||||
// on whether it meets the match criteria.
|
||||
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
||||
// +structType=atomic
|
||||
#MatchResources: {
|
||||
// NamespaceSelector decides whether to run the admission control policy on an object based
|
||||
// on whether the namespace for that object matches the selector. If the
|
||||
// object itself is a namespace, the matching is performed on
|
||||
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||
// it never skips the policy.
|
||||
//
|
||||
// For example, to run the webhook on any objects whose namespace is not
|
||||
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||
// follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "runlevel",
|
||||
// "operator": "NotIn",
|
||||
// "values": [
|
||||
// "0",
|
||||
// "1"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// If instead you want to only run the policy on any objects whose
|
||||
// namespace is associated with the "environment" of "prod" or "staging";
|
||||
// you will set the selector as follows:
|
||||
// "namespaceSelector": {
|
||||
// "matchExpressions": [
|
||||
// {
|
||||
// "key": "environment",
|
||||
// "operator": "In",
|
||||
// "values": [
|
||||
// "prod",
|
||||
// "staging"
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// See
|
||||
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
// for more examples of label selectors.
|
||||
//
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
namespaceSelector?: null | metav1.#LabelSelector @go(NamespaceSelector,*metav1.LabelSelector) @protobuf(1,bytes,opt)
|
||||
|
||||
// ObjectSelector decides whether to run the validation based on if the
|
||||
// object has matching labels. objectSelector is evaluated against both
|
||||
// the oldObject and newObject that would be sent to the cel validation, and
|
||||
// is considered to match if either object matches the selector. A null
|
||||
// object (oldObject in the case of create, or newObject in the case of
|
||||
// delete) or an object that cannot have labels (like a
|
||||
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||
// match.
|
||||
// Use the object selector only if the webhook is opt-in, because end
|
||||
// users may skip the admission webhook by setting the labels.
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
// +optional
|
||||
objectSelector?: null | metav1.#LabelSelector @go(ObjectSelector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
|
||||
// The policy cares about an operation if it matches _any_ Rule.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
resourceRules?: [...#NamedRuleWithOperations] @go(ResourceRules,[]NamedRuleWithOperations) @protobuf(3,bytes,rep)
|
||||
|
||||
// ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.
|
||||
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
excludeResourceRules?: [...#NamedRuleWithOperations] @go(ExcludeResourceRules,[]NamedRuleWithOperations) @protobuf(4,bytes,rep)
|
||||
|
||||
// matchPolicy defines how the "MatchResources" list is used to match incoming requests.
|
||||
// Allowed values are "Exact" or "Equivalent".
|
||||
//
|
||||
// - Exact: match a request only if it exactly matches a specified rule.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
|
||||
//
|
||||
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
|
||||
//
|
||||
// Defaults to "Equivalent"
|
||||
// +optional
|
||||
matchPolicy?: null | #MatchPolicyType @go(MatchPolicy,*MatchPolicyType) @protobuf(7,bytes,opt,casttype=MatchPolicyType)
|
||||
}
|
||||
|
||||
// ValidationAction specifies a policy enforcement action.
|
||||
// +enum
|
||||
#ValidationAction: string // #enumValidationAction
|
||||
|
||||
#enumValidationAction:
|
||||
#Deny |
|
||||
#Warn |
|
||||
#Audit
|
||||
|
||||
// Deny specifies that a validation failure results in a denied request.
|
||||
#Deny: #ValidationAction & "Deny"
|
||||
|
||||
// Warn specifies that a validation failure is reported to the request client
|
||||
// in HTTP Warning headers, with a warning code of 299. Warnings can be sent
|
||||
// both for allowed or denied admission responses.
|
||||
#Warn: #ValidationAction & "Warn"
|
||||
|
||||
// Audit specifies that a validation failure is included in the published
|
||||
// audit event for the request. The audit event will contain a
|
||||
// `validation.policy.admission.k8s.io/validation_failure` audit annotation
|
||||
// with a value containing the details of the validation failure.
|
||||
#Audit: #ValidationAction & "Audit"
|
||||
|
||||
// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
|
||||
// +structType=atomic
|
||||
#NamedRuleWithOperations: {
|
||||
// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
resourceNames?: [...string] @go(ResourceNames,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
v1.#RuleWithOperations
|
||||
}
|
||||
|
||||
// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
|
||||
// sure that all the tuple expansions are valid.
|
||||
#RuleWithOperations: v1.#RuleWithOperations
|
||||
|
||||
// OperationType specifies an operation for a request.
|
||||
// +enum
|
||||
#OperationType: v1.#OperationType // #enumOperationType
|
||||
|
||||
#enumOperationType:
|
||||
#OperationAll |
|
||||
#Create |
|
||||
#Update |
|
||||
#Delete |
|
||||
#Connect
|
||||
|
||||
#OperationAll: v1.#OperationType & "*"
|
||||
#Create: v1.#OperationType & "CREATE"
|
||||
#Update: v1.#OperationType & "UPDATE"
|
||||
#Delete: v1.#OperationType & "DELETE"
|
||||
#Connect: v1.#OperationType & "CONNECT"
|
||||
@@ -0,0 +1,9 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1beta1
|
||||
|
||||
// Package v1beta1 is the v1beta1 version of the API.
|
||||
// AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration
|
||||
// MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the
|
||||
// new dynamic admission controller configuration.
|
||||
package v1beta1
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/admissionregistration/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
#GroupName: "admissionregistration.k8s.io"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apidiscovery/v2beta1
|
||||
|
||||
package v2beta1
|
||||
|
||||
#GroupName: "apidiscovery.k8s.io"
|
||||
@@ -0,0 +1,157 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apidiscovery/v2beta1
|
||||
|
||||
package v2beta1
|
||||
|
||||
import "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery.
|
||||
// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated
|
||||
// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers)
|
||||
// that a cluster supports.
|
||||
#APIGroupDiscoveryList: {
|
||||
v1.#TypeMeta
|
||||
|
||||
// ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: v1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// items is the list of groups for discovery. The groups are listed in priority order.
|
||||
items: [...#APIGroupDiscovery] @go(Items,[]APIGroupDiscovery) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// APIGroupDiscovery holds information about which resources are being served for all version of the API Group.
|
||||
// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version.
|
||||
// Versions are in descending order of preference, with the first version being the preferred entry.
|
||||
#APIGroupDiscovery: {
|
||||
v1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// The only field completed will be name. For instance, resourceVersion will be empty.
|
||||
// name is the name of the API group whose discovery information is presented here.
|
||||
// name is allowed to be "" to represent the legacy, ungroupified resources.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: v1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// versions are the versions supported in this group. They are sorted in descending order of preference,
|
||||
// with the preferred version being the first entry.
|
||||
// +listType=map
|
||||
// +listMapKey=version
|
||||
versions?: [...#APIVersionDiscovery] @go(Versions,[]APIVersionDiscovery) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group.
|
||||
#APIVersionDiscovery: {
|
||||
// version is the name of the version within a group version.
|
||||
version: string @go(Version) @protobuf(1,bytes,opt)
|
||||
|
||||
// resources is a list of APIResourceDiscovery objects for the corresponding group version.
|
||||
// +listType=map
|
||||
// +listMapKey=resource
|
||||
resources?: [...#APIResourceDiscovery] @go(Resources,[]APIResourceDiscovery) @protobuf(2,bytes,rep)
|
||||
|
||||
// freshness marks whether a group version's discovery document is up to date.
|
||||
// "Current" indicates the discovery document was recently
|
||||
// refreshed. "Stale" indicates the discovery document could not
|
||||
// be retrieved and the returned discovery document may be
|
||||
// significantly out of date. Clients that require the latest
|
||||
// version of the discovery information be retrieved before
|
||||
// performing an operation should not use the aggregated document
|
||||
freshness?: #DiscoveryFreshness @go(Freshness) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// APIResourceDiscovery provides information about an API resource for discovery.
|
||||
#APIResourceDiscovery: {
|
||||
// resource is the plural name of the resource. This is used in the URL path and is the unique identifier
|
||||
// for this resource across all versions in the API group.
|
||||
// Resources with non-empty groups are located at /apis/<APIGroupDiscovery.objectMeta.name>/<APIVersionDiscovery.version>/<APIResourceDiscovery.Resource>
|
||||
// Resources with empty groups are located at /api/v1/<APIResourceDiscovery.Resource>
|
||||
resource: string @go(Resource) @protobuf(1,bytes,opt)
|
||||
|
||||
// responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
|
||||
// APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior.
|
||||
// This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource
|
||||
responseKind?: null | v1.#GroupVersionKind @go(ResponseKind,*v1.GroupVersionKind) @protobuf(2,bytes,opt)
|
||||
|
||||
// scope indicates the scope of a resource, either Cluster or Namespaced
|
||||
scope: #ResourceScope @go(Scope) @protobuf(3,bytes,opt)
|
||||
|
||||
// singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely.
|
||||
// For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence.
|
||||
// The command line tool kubectl, for example, allows use of the singular resource name in place of plurals.
|
||||
// The singular form of a resource should always be an optional element - when in doubt use the canonical resource name.
|
||||
singularResource: string @go(SingularResource) @protobuf(4,bytes,opt)
|
||||
|
||||
// verbs is a list of supported API operation types (this includes
|
||||
// but is not limited to get, list, watch, create, update, patch,
|
||||
// delete, deletecollection, and proxy).
|
||||
// +listType=set
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(5,bytes,opt)
|
||||
|
||||
// shortNames is a list of suggested short names of the resource.
|
||||
// +listType=set
|
||||
shortNames?: [...string] @go(ShortNames,[]string) @protobuf(6,bytes,rep)
|
||||
|
||||
// categories is a list of the grouped resources this resource belongs to (e.g. 'all').
|
||||
// Clients may use this to simplify acting on multiple resource types at once.
|
||||
// +listType=set
|
||||
categories?: [...string] @go(Categories,[]string) @protobuf(7,bytes,rep)
|
||||
|
||||
// subresources is a list of subresources provided by this resource. Subresources are located at /apis/<APIGroupDiscovery.objectMeta.name>/<APIVersionDiscovery.version>/<APIResourceDiscovery.Resource>/name-of-instance/<APIResourceDiscovery.subresources[i].subresource>
|
||||
// +listType=map
|
||||
// +listMapKey=subresource
|
||||
subresources?: [...#APISubresourceDiscovery] @go(Subresources,[]APISubresourceDiscovery) @protobuf(8,bytes,rep)
|
||||
}
|
||||
|
||||
// ResourceScope is an enum defining the different scopes available to a resource.
|
||||
#ResourceScope: string // #enumResourceScope
|
||||
|
||||
#enumResourceScope:
|
||||
#ScopeCluster |
|
||||
#ScopeNamespace
|
||||
|
||||
#ScopeCluster: #ResourceScope & "Cluster"
|
||||
#ScopeNamespace: #ResourceScope & "Namespaced"
|
||||
|
||||
// DiscoveryFreshness is an enum defining whether the Discovery document published by an apiservice is up to date (fresh).
|
||||
#DiscoveryFreshness: string // #enumDiscoveryFreshness
|
||||
|
||||
#enumDiscoveryFreshness:
|
||||
#DiscoveryFreshnessCurrent |
|
||||
#DiscoveryFreshnessStale
|
||||
|
||||
#DiscoveryFreshnessCurrent: #DiscoveryFreshness & "Current"
|
||||
#DiscoveryFreshnessStale: #DiscoveryFreshness & "Stale"
|
||||
|
||||
// APISubresourceDiscovery provides information about an API subresource for discovery.
|
||||
#APISubresourceDiscovery: {
|
||||
// subresource is the name of the subresource. This is used in the URL path and is the unique identifier
|
||||
// for this resource across all versions.
|
||||
subresource: string @go(Subresource) @protobuf(1,bytes,opt)
|
||||
|
||||
// responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
|
||||
// Some subresources do not return normal resources, these will have null or empty return types.
|
||||
responseKind?: null | v1.#GroupVersionKind @go(ResponseKind,*v1.GroupVersionKind) @protobuf(2,bytes,opt)
|
||||
|
||||
// acceptedTypes describes the kinds that this endpoint accepts.
|
||||
// Subresources may accept the standard content types or define
|
||||
// custom negotiation schemes. The list may not be exhaustive for
|
||||
// all operations.
|
||||
// +listType=map
|
||||
// +listMapKey=group
|
||||
// +listMapKey=version
|
||||
// +listMapKey=kind
|
||||
acceptedTypes?: [...v1.#GroupVersionKind] @go(AcceptedTypes,[]v1.GroupVersionKind) @protobuf(3,bytes,rep)
|
||||
|
||||
// verbs is a list of supported API operation types (this includes
|
||||
// but is not limited to get, list, watch, create, update, patch,
|
||||
// delete, deletecollection, and proxy). Subresources may define
|
||||
// custom verbs outside the standard Kubernetes verb set. Clients
|
||||
// should expect the behavior of standard verbs to align with
|
||||
// Kubernetes interaction conventions.
|
||||
// +listType=set
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(4,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apiserverinternal/v1alpha1
|
||||
|
||||
// Package v1alpha1 contains the v1alpha1 version of the API used by the
|
||||
// apiservers themselves.
|
||||
package v1alpha1
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apiserverinternal/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#GroupName: "internal.apiserver.k8s.io"
|
||||
@@ -0,0 +1,129 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apiserverinternal/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// Storage version of a specific resource.
|
||||
#StorageVersion: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// The name is <group>.<resource>.
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec is an empty spec. It is here to comply with Kubernetes API style.
|
||||
spec: #StorageVersionSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// API server instances report the version they can decode and the version they
|
||||
// encode objects to when persisting objects in the backend.
|
||||
status: #StorageVersionStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// StorageVersionSpec is an empty spec.
|
||||
#StorageVersionSpec: {
|
||||
}
|
||||
|
||||
// API server instances report the versions they can decode and the version they
|
||||
// encode objects to when persisting objects in the backend.
|
||||
#StorageVersionStatus: {
|
||||
// The reported versions per API server instance.
|
||||
// +optional
|
||||
// +listType=map
|
||||
// +listMapKey=apiServerID
|
||||
storageVersions?: [...#ServerStorageVersion] @go(StorageVersions,[]ServerStorageVersion) @protobuf(1,bytes,opt)
|
||||
|
||||
// If all API server instances agree on the same encoding storage version,
|
||||
// then this field is set to that version. Otherwise this field is left empty.
|
||||
// API servers should finish updating its storageVersionStatus entry before
|
||||
// serving write operations, so that this field will be in sync with the reality.
|
||||
// +optional
|
||||
commonEncodingVersion?: null | string @go(CommonEncodingVersion,*string) @protobuf(2,bytes,opt)
|
||||
|
||||
// The latest available observations of the storageVersion's state.
|
||||
// +optional
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
conditions?: [...#StorageVersionCondition] @go(Conditions,[]StorageVersionCondition) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// An API server instance reports the version it can decode and the version it
|
||||
// encodes objects to when persisting objects in the backend.
|
||||
#ServerStorageVersion: {
|
||||
// The ID of the reporting API server.
|
||||
apiServerID?: string @go(APIServerID) @protobuf(1,bytes,opt)
|
||||
|
||||
// The API server encodes the object to this version when persisting it in
|
||||
// the backend (e.g., etcd).
|
||||
encodingVersion?: string @go(EncodingVersion) @protobuf(2,bytes,opt)
|
||||
|
||||
// The API server can decode objects encoded in these versions.
|
||||
// The encodingVersion must be included in the decodableVersions.
|
||||
// +listType=set
|
||||
decodableVersions?: [...string] @go(DecodableVersions,[]string) @protobuf(3,bytes,opt)
|
||||
|
||||
// The API server can serve these versions.
|
||||
// DecodableVersions must include all ServedVersions.
|
||||
// +listType=set
|
||||
servedVersions?: [...string] @go(ServedVersions,[]string) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
#StorageVersionConditionType: string // #enumStorageVersionConditionType
|
||||
|
||||
#enumStorageVersionConditionType:
|
||||
#AllEncodingVersionsEqual
|
||||
|
||||
// Indicates that encoding storage versions reported by all servers are equal.
|
||||
#AllEncodingVersionsEqual: #StorageVersionConditionType & "AllEncodingVersionsEqual"
|
||||
|
||||
#ConditionStatus: string // #enumConditionStatus
|
||||
|
||||
#enumConditionStatus:
|
||||
#ConditionTrue |
|
||||
#ConditionFalse |
|
||||
#ConditionUnknown
|
||||
|
||||
#ConditionTrue: #ConditionStatus & "True"
|
||||
#ConditionFalse: #ConditionStatus & "False"
|
||||
#ConditionUnknown: #ConditionStatus & "Unknown"
|
||||
|
||||
// Describes the state of the storageVersion at a certain point.
|
||||
#StorageVersionCondition: {
|
||||
// Type of the condition.
|
||||
// +required
|
||||
type: #StorageVersionConditionType @go(Type) @protobuf(1,bytes,opt)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
// +required
|
||||
status: #ConditionStatus @go(Status) @protobuf(2,bytes,opt)
|
||||
|
||||
// If set, this represents the .metadata.generation that the condition was set based upon.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(3,varint,opt)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +required
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(4,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
// +required
|
||||
reason: string @go(Reason) @protobuf(5,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// +required
|
||||
message?: string @go(Message) @protobuf(6,bytes,opt)
|
||||
}
|
||||
|
||||
// A list of StorageVersions.
|
||||
#StorageVersionList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Items holds a list of StorageVersion
|
||||
items: [...#StorageVersion] @go(Items,[]StorageVersion) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apps/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
#GroupName: "apps"
|
||||
@@ -0,0 +1,656 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apps/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
#ControllerRevisionHashLabelKey: "controller-revision-hash"
|
||||
#StatefulSetRevisionLabel: "controller-revision-hash"
|
||||
#StatefulSetPodNameLabel: "statefulset.kubernetes.io/pod-name"
|
||||
|
||||
// ScaleSpec describes the attributes of a scale subresource
|
||||
#ScaleSpec: {
|
||||
// replicas is the number of observed instances of the scaled object.
|
||||
// +optional
|
||||
replicas?: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// ScaleStatus represents the current status of a scale subresource.
|
||||
#ScaleStatus: {
|
||||
// replias is the actual number of observed instances of the scaled object.
|
||||
replicas: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
// +optional
|
||||
selector?: {[string]: string} @go(Selector,map[string]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// targetSelector is the label selector for pods that should match the replicas count. This is a serializated
|
||||
// version of both map-based and more expressive set-based selectors. This is done to
|
||||
// avoid introspection in the clients. The string will be in the same format as the
|
||||
// query-param syntax. If the target type only supports map-based selectors, both this
|
||||
// field and map-based selector field are populated.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
// +optional
|
||||
targetSelector?: string @go(TargetSelector) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// Scale represents a scaling request for a resource.
|
||||
#Scale: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #ScaleSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// status defines current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
|
||||
// +optional
|
||||
status?: #ScaleStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of StatefulSet is deprecated by apps/v1beta2/StatefulSet. See the release notes for
|
||||
// more information.
|
||||
// StatefulSet represents a set of pods with consistent identities.
|
||||
// Identities are defined as:
|
||||
// - Network: A single stable DNS and hostname.
|
||||
// - Storage: As many VolumeClaims as requested.
|
||||
//
|
||||
// The StatefulSet guarantees that a given network identity will always
|
||||
// map to the same storage identity.
|
||||
#StatefulSet: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec defines the desired identities of pods in this set.
|
||||
// +optional
|
||||
spec?: #StatefulSetSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is the current status of Pods in this StatefulSet. This data
|
||||
// may be out of date by some window of time.
|
||||
// +optional
|
||||
status?: #StatefulSetStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// PodManagementPolicyType defines the policy for creating pods under a stateful set.
|
||||
#PodManagementPolicyType: string // #enumPodManagementPolicyType
|
||||
|
||||
#enumPodManagementPolicyType:
|
||||
#OrderedReadyPodManagement |
|
||||
#ParallelPodManagement
|
||||
|
||||
// OrderedReadyPodManagement will create pods in strictly increasing order on
|
||||
// scale up and strictly decreasing order on scale down, progressing only when
|
||||
// the previous pod is ready or terminated. At most one pod will be changed
|
||||
// at any time.
|
||||
#OrderedReadyPodManagement: #PodManagementPolicyType & "OrderedReady"
|
||||
|
||||
// ParallelPodManagement will create and delete pods as soon as the stateful set
|
||||
// replica count is changed, and will not wait for pods to be ready or complete
|
||||
// termination.
|
||||
#ParallelPodManagement: #PodManagementPolicyType & "Parallel"
|
||||
|
||||
// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet
|
||||
// controller will use to perform updates. It includes any additional parameters
|
||||
// necessary to perform the update for the indicated strategy.
|
||||
#StatefulSetUpdateStrategy: {
|
||||
// Type indicates the type of the StatefulSetUpdateStrategy.
|
||||
type?: #StatefulSetUpdateStrategyType @go(Type) @protobuf(1,bytes,opt,casttype=StatefulSetStrategyType)
|
||||
|
||||
// RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
|
||||
rollingUpdate?: null | #RollingUpdateStatefulSetStrategy @go(RollingUpdate,*RollingUpdateStatefulSetStrategy) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetUpdateStrategyType is a string enumeration type that enumerates
|
||||
// all possible update strategies for the StatefulSet controller.
|
||||
#StatefulSetUpdateStrategyType: string // #enumStatefulSetUpdateStrategyType
|
||||
|
||||
#enumStatefulSetUpdateStrategyType:
|
||||
#RollingUpdateStatefulSetStrategyType |
|
||||
#OnDeleteStatefulSetStrategyType
|
||||
|
||||
// RollingUpdateStatefulSetStrategyType indicates that update will be
|
||||
// applied to all Pods in the StatefulSet with respect to the StatefulSet
|
||||
// ordering constraints. When a scale operation is performed with this
|
||||
// strategy, new Pods will be created from the specification version indicated
|
||||
// by the StatefulSet's updateRevision.
|
||||
#RollingUpdateStatefulSetStrategyType: #StatefulSetUpdateStrategyType & "RollingUpdate"
|
||||
|
||||
// OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version
|
||||
// tracking and ordered rolling restarts are disabled. Pods are recreated
|
||||
// from the StatefulSetSpec when they are manually deleted. When a scale
|
||||
// operation is performed with this strategy,specification version indicated
|
||||
// by the StatefulSet's currentRevision.
|
||||
#OnDeleteStatefulSetStrategyType: #StatefulSetUpdateStrategyType & "OnDelete"
|
||||
|
||||
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
|
||||
#RollingUpdateStatefulSetStrategy: {
|
||||
// Partition indicates the ordinal at which the StatefulSet should be partitioned
|
||||
// for updates. During a rolling update, all pods from ordinal Replicas-1 to
|
||||
// Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
|
||||
// This is helpful in being able to do a canary based deployment. The default value is 0.
|
||||
partition?: null | int32 @go(Partition,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// maxUnavailable is the maximum number of pods that can be unavailable during the update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// Absolute number is calculated from percentage by rounding up. This can not be 0.
|
||||
// Defaults to 1. This field is alpha-level and is only honored by servers that enable the
|
||||
// MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
|
||||
// Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
|
||||
// will be counted towards MaxUnavailable.
|
||||
// +optional
|
||||
maxUnavailable?: null | intstr.#IntOrString @go(MaxUnavailable,*intstr.IntOrString) @protobuf(2,varint,opt)
|
||||
}
|
||||
|
||||
// PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine
|
||||
// when volumes from the VolumeClaimTemplates will be deleted when the controlling StatefulSet is
|
||||
// deleted or scaled down.
|
||||
#PersistentVolumeClaimRetentionPolicyType: string // #enumPersistentVolumeClaimRetentionPolicyType
|
||||
|
||||
#enumPersistentVolumeClaimRetentionPolicyType:
|
||||
#RetainPersistentVolumeClaimRetentionPolicyType |
|
||||
#RetentionPersistentVolumeClaimRetentionPolicyType
|
||||
|
||||
// RetainPersistentVolumeClaimRetentionPolicyType is the default
|
||||
// PersistentVolumeClaimRetentionPolicy and specifies that
|
||||
// PersistentVolumeClaims associated with StatefulSet VolumeClaimTemplates
|
||||
// will not be deleted.
|
||||
#RetainPersistentVolumeClaimRetentionPolicyType: #PersistentVolumeClaimRetentionPolicyType & "Retain"
|
||||
|
||||
// RetentionPersistentVolumeClaimRetentionPolicyType specifies that
|
||||
// PersistentVolumeClaims associated with StatefulSet VolumeClaimTemplates
|
||||
// will be deleted in the scenario specified in
|
||||
// StatefulSetPersistentVolumeClaimRetentionPolicy.
|
||||
#RetentionPersistentVolumeClaimRetentionPolicyType: #PersistentVolumeClaimRetentionPolicyType & "Delete"
|
||||
|
||||
// StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs
|
||||
// created from the StatefulSet VolumeClaimTemplates.
|
||||
#StatefulSetPersistentVolumeClaimRetentionPolicy: {
|
||||
// whenDeleted specifies what happens to PVCs created from StatefulSet
|
||||
// VolumeClaimTemplates when the StatefulSet is deleted. The default policy
|
||||
// of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
|
||||
// `Delete` policy causes those PVCs to be deleted.
|
||||
whenDeleted?: #PersistentVolumeClaimRetentionPolicyType @go(WhenDeleted) @protobuf(1,bytes,opt,casttype=PersistentVolumeClaimRetentionPolicyType)
|
||||
|
||||
// whenScaled specifies what happens to PVCs created from StatefulSet
|
||||
// VolumeClaimTemplates when the StatefulSet is scaled down. The default
|
||||
// policy of `Retain` causes PVCs to not be affected by a scaledown. The
|
||||
// `Delete` policy causes the associated PVCs for any excess pods above
|
||||
// the replica count to be deleted.
|
||||
whenScaled?: #PersistentVolumeClaimRetentionPolicyType @go(WhenScaled) @protobuf(2,bytes,opt,casttype=PersistentVolumeClaimRetentionPolicyType)
|
||||
}
|
||||
|
||||
// StatefulSetOrdinals describes the policy used for replica ordinal assignment
|
||||
// in this StatefulSet.
|
||||
#StatefulSetOrdinals: {
|
||||
// start is the number representing the first replica's index. It may be used
|
||||
// to number replicas from an alternate index (eg: 1-indexed) over the default
|
||||
// 0-indexed names, or to orchestrate progressive movement of replicas from
|
||||
// one StatefulSet to another.
|
||||
// If set, replica indices will be in the range:
|
||||
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
|
||||
// If unset, defaults to 0. Replica indices will be in the range:
|
||||
// [0, .spec.replicas).
|
||||
// +optional
|
||||
start?: int32 @go(Start) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// A StatefulSetSpec is the specification of a StatefulSet.
|
||||
#StatefulSetSpec: {
|
||||
// replicas is the desired number of replicas of the given Template.
|
||||
// These are replicas in the sense that they are instantiations of the
|
||||
// same Template, but individual replicas also have a consistent identity.
|
||||
// If unspecified, defaults to 1.
|
||||
// TODO: Consider a rename of this field.
|
||||
// +optional
|
||||
replicas?: null | int32 @go(Replicas,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is a label query over pods that should match the replica count.
|
||||
// If empty, defaulted to labels on the pod template.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// template is the object that describes the pod that will be created if
|
||||
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
|
||||
// will fulfill this Template, but have a unique identity from the rest
|
||||
// of the StatefulSet. Each pod will be named with the format
|
||||
// <statefulsetname>-<podindex>. For example, a pod in a StatefulSet named
|
||||
// "web" with index number "3" would be named "web-3".
|
||||
template: v1.#PodTemplateSpec @go(Template) @protobuf(3,bytes,opt)
|
||||
|
||||
// volumeClaimTemplates is a list of claims that pods are allowed to reference.
|
||||
// The StatefulSet controller is responsible for mapping network identities to
|
||||
// claims in a way that maintains the identity of a pod. Every claim in
|
||||
// this list must have at least one matching (by name) volumeMount in one
|
||||
// container in the template. A claim in this list takes precedence over
|
||||
// any volumes in the template, with the same name.
|
||||
// TODO: Define the behavior if a claim already exists with the same name.
|
||||
// +optional
|
||||
volumeClaimTemplates?: [...v1.#PersistentVolumeClaim] @go(VolumeClaimTemplates,[]v1.PersistentVolumeClaim) @protobuf(4,bytes,rep)
|
||||
|
||||
// serviceName is the name of the service that governs this StatefulSet.
|
||||
// This service must exist before the StatefulSet, and is responsible for
|
||||
// the network identity of the set. Pods get DNS/hostnames that follow the
|
||||
// pattern: pod-specific-string.serviceName.default.svc.cluster.local
|
||||
// where "pod-specific-string" is managed by the StatefulSet controller.
|
||||
serviceName: string @go(ServiceName) @protobuf(5,bytes,opt)
|
||||
|
||||
// podManagementPolicy controls how pods are created during initial scale up,
|
||||
// when replacing pods on nodes, or when scaling down. The default policy is
|
||||
// `OrderedReady`, where pods are created in increasing order (pod-0, then
|
||||
// pod-1, etc) and the controller will wait until each pod is ready before
|
||||
// continuing. When scaling down, the pods are removed in the opposite order.
|
||||
// The alternative policy is `Parallel` which will create pods in parallel
|
||||
// to match the desired scale without waiting, and on scale down will delete
|
||||
// all pods at once.
|
||||
// +optional
|
||||
podManagementPolicy?: #PodManagementPolicyType @go(PodManagementPolicy) @protobuf(6,bytes,opt,casttype=PodManagementPolicyType)
|
||||
|
||||
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
|
||||
// employed to update Pods in the StatefulSet when a revision is made to
|
||||
// Template.
|
||||
updateStrategy?: #StatefulSetUpdateStrategy @go(UpdateStrategy) @protobuf(7,bytes,opt)
|
||||
|
||||
// revisionHistoryLimit is the maximum number of revisions that will
|
||||
// be maintained in the StatefulSet's revision history. The revision history
|
||||
// consists of all revisions not represented by a currently applied
|
||||
// StatefulSetSpec version. The default value is 10.
|
||||
revisionHistoryLimit?: null | int32 @go(RevisionHistoryLimit,*int32) @protobuf(8,varint,opt)
|
||||
|
||||
// minReadySeconds is the minimum number of seconds for which a newly created pod should be ready
|
||||
// without any of its container crashing for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(9,varint,opt)
|
||||
|
||||
// PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from
|
||||
// the StatefulSet VolumeClaimTemplates. This requires the
|
||||
// StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.
|
||||
// +optional
|
||||
persistentVolumeClaimRetentionPolicy?: null | #StatefulSetPersistentVolumeClaimRetentionPolicy @go(PersistentVolumeClaimRetentionPolicy,*StatefulSetPersistentVolumeClaimRetentionPolicy) @protobuf(10,bytes,opt)
|
||||
|
||||
// ordinals controls the numbering of replica indices in a StatefulSet. The
|
||||
// default ordinals behavior assigns a "0" index to the first replica and
|
||||
// increments the index by one for each additional replica requested. Using
|
||||
// the ordinals field requires the StatefulSetStartOrdinal feature gate to be
|
||||
// enabled, which is beta.
|
||||
// +optional
|
||||
ordinals?: null | #StatefulSetOrdinals @go(Ordinals,*StatefulSetOrdinals) @protobuf(11,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetStatus represents the current state of a StatefulSet.
|
||||
#StatefulSetStatus: {
|
||||
// observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
|
||||
// StatefulSet's generation, which is updated on mutation by the API Server.
|
||||
// +optional
|
||||
observedGeneration?: null | int64 @go(ObservedGeneration,*int64) @protobuf(1,varint,opt)
|
||||
|
||||
// replicas is the number of Pods created by the StatefulSet controller.
|
||||
replicas: int32 @go(Replicas) @protobuf(2,varint,opt)
|
||||
|
||||
// readyReplicas is the number of pods created by this StatefulSet controller with a Ready Condition.
|
||||
readyReplicas?: int32 @go(ReadyReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
||||
// indicated by currentRevision.
|
||||
currentReplicas?: int32 @go(CurrentReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
||||
// indicated by updateRevision.
|
||||
updatedReplicas?: int32 @go(UpdatedReplicas) @protobuf(5,varint,opt)
|
||||
|
||||
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
|
||||
// sequence [0,currentReplicas).
|
||||
currentRevision?: string @go(CurrentRevision) @protobuf(6,bytes,opt)
|
||||
|
||||
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
|
||||
// [replicas-updatedReplicas,replicas)
|
||||
updateRevision?: string @go(UpdateRevision) @protobuf(7,bytes,opt)
|
||||
|
||||
// collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
|
||||
// uses this field as a collision avoidance mechanism when it needs to create the name for the
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
collisionCount?: null | int32 @go(CollisionCount,*int32) @protobuf(9,varint,opt)
|
||||
|
||||
// conditions represent the latest available observations of a statefulset's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#StatefulSetCondition] @go(Conditions,[]StatefulSetCondition) @protobuf(10,bytes,rep)
|
||||
|
||||
// availableReplicas is the total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet.
|
||||
// +optional
|
||||
availableReplicas?: int32 @go(AvailableReplicas) @protobuf(11,varint,opt)
|
||||
}
|
||||
|
||||
#StatefulSetConditionType: string
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
#StatefulSetCondition: {
|
||||
// Type of statefulset condition.
|
||||
type: #StatefulSetConditionType @go(Type) @protobuf(1,bytes,opt,casttype=StatefulSetConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetList is a collection of StatefulSets.
|
||||
#StatefulSetList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
items: [...#StatefulSet] @go(Items,[]StatefulSet) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for
|
||||
// more information.
|
||||
// Deployment enables declarative updates for Pods and ReplicaSets.
|
||||
#Deployment: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Specification of the desired behavior of the Deployment.
|
||||
// +optional
|
||||
spec?: #DeploymentSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Most recently observed status of the Deployment.
|
||||
// +optional
|
||||
status?: #DeploymentStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentSpec is the specification of the desired behavior of the Deployment.
|
||||
#DeploymentSpec: {
|
||||
// replicas is the number of desired pods. This is a pointer to distinguish between explicit
|
||||
// zero and not specified. Defaults to 1.
|
||||
// +optional
|
||||
replicas?: null | int32 @go(Replicas,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is the label selector for pods. Existing ReplicaSets whose pods are
|
||||
// selected by this will be the ones affected by this deployment.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// Template describes the pods that will be created.
|
||||
// The only allowed template.spec.restartPolicy value is "Always".
|
||||
template: v1.#PodTemplateSpec @go(Template) @protobuf(3,bytes,opt)
|
||||
|
||||
// The deployment strategy to use to replace existing pods with new ones.
|
||||
// +optional
|
||||
// +patchStrategy=retainKeys
|
||||
strategy?: #DeploymentStrategy @go(Strategy) @protobuf(4,bytes,opt)
|
||||
|
||||
// minReadySeconds is the minimum number of seconds for which a newly created pod should be ready
|
||||
// without any of its container crashing, for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(5,varint,opt)
|
||||
|
||||
// revisionHistoryLimit is the number of old ReplicaSets to retain to allow rollback.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// Defaults to 2.
|
||||
// +optional
|
||||
revisionHistoryLimit?: null | int32 @go(RevisionHistoryLimit,*int32) @protobuf(6,varint,opt)
|
||||
|
||||
// paused indicates that the deployment is paused.
|
||||
// +optional
|
||||
paused?: bool @go(Paused) @protobuf(7,varint,opt)
|
||||
|
||||
// DEPRECATED.
|
||||
// rollbackTo is the config this deployment is rolling back to. Will be cleared after rollback is done.
|
||||
// +optional
|
||||
rollbackTo?: null | #RollbackConfig @go(RollbackTo,*RollbackConfig) @protobuf(8,bytes,opt)
|
||||
|
||||
// progressDeadlineSeconds is the maximum time in seconds for a deployment to make progress before it
|
||||
// is considered to be failed. The deployment controller will continue to
|
||||
// process failed deployments and a condition with a ProgressDeadlineExceeded
|
||||
// reason will be surfaced in the deployment status. Note that progress will
|
||||
// not be estimated during the time a deployment is paused. Defaults to 600s.
|
||||
// +optional
|
||||
progressDeadlineSeconds?: null | int32 @go(ProgressDeadlineSeconds,*int32) @protobuf(9,varint,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
// DeploymentRollback stores the information required to rollback a deployment.
|
||||
#DeploymentRollback: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Required: This must match the Name of a deployment.
|
||||
name: string @go(Name) @protobuf(1,bytes,opt)
|
||||
|
||||
// The annotations to be updated to a deployment
|
||||
// +optional
|
||||
updatedAnnotations?: {[string]: string} @go(UpdatedAnnotations,map[string]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// The config of this deployment rollback.
|
||||
rollbackTo: #RollbackConfig @go(RollbackTo) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
#RollbackConfig: {
|
||||
// The revision to rollback to. If set to 0, rollback to the last revision.
|
||||
// +optional
|
||||
revision?: int64 @go(Revision) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
|
||||
// to existing ReplicaSets (and label key that is added to its pods) to prevent the existing ReplicaSets
|
||||
// to select new pods (and old pods being select by new ReplicaSet).
|
||||
#DefaultDeploymentUniqueLabelKey: "pod-template-hash"
|
||||
|
||||
// DeploymentStrategy describes how to replace existing pods with new ones.
|
||||
#DeploymentStrategy: {
|
||||
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||
// +optional
|
||||
type?: #DeploymentStrategyType @go(Type) @protobuf(1,bytes,opt,casttype=DeploymentStrategyType)
|
||||
|
||||
// Rolling update config params. Present only if DeploymentStrategyType =
|
||||
// RollingUpdate.
|
||||
//---
|
||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||
// to be.
|
||||
// +optional
|
||||
rollingUpdate?: null | #RollingUpdateDeployment @go(RollingUpdate,*RollingUpdateDeployment) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
#DeploymentStrategyType: string // #enumDeploymentStrategyType
|
||||
|
||||
#enumDeploymentStrategyType:
|
||||
#RecreateDeploymentStrategyType |
|
||||
#RollingUpdateDeploymentStrategyType
|
||||
|
||||
// Kill all existing pods before creating new ones.
|
||||
#RecreateDeploymentStrategyType: #DeploymentStrategyType & "Recreate"
|
||||
|
||||
// Replace the old ReplicaSets by new one using rolling update i.e gradually scale down the old ReplicaSets and scale up the new one.
|
||||
#RollingUpdateDeploymentStrategyType: #DeploymentStrategyType & "RollingUpdate"
|
||||
|
||||
// Spec to control the desired behavior of rolling update.
|
||||
#RollingUpdateDeployment: {
|
||||
// The maximum number of pods that can be unavailable during the update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// Absolute number is calculated from percentage by rounding down.
|
||||
// This can not be 0 if MaxSurge is 0.
|
||||
// Defaults to 25%.
|
||||
// Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
|
||||
// immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
|
||||
// can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
|
||||
// that the total number of pods available at all times during the update is at
|
||||
// least 70% of desired pods.
|
||||
// +optional
|
||||
maxUnavailable?: null | intstr.#IntOrString @go(MaxUnavailable,*intstr.IntOrString) @protobuf(1,bytes,opt)
|
||||
|
||||
// The maximum number of pods that can be scheduled above the desired number of
|
||||
// pods.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// This can not be 0 if MaxUnavailable is 0.
|
||||
// Absolute number is calculated from percentage by rounding up.
|
||||
// Defaults to 25%.
|
||||
// Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
|
||||
// the rolling update starts, such that the total number of old and new pods do not exceed
|
||||
// 130% of desired pods. Once old pods have been killed,
|
||||
// new ReplicaSet can be scaled up further, ensuring that total number of pods running
|
||||
// at any time during the update is at most 130% of desired pods.
|
||||
// +optional
|
||||
maxSurge?: null | intstr.#IntOrString @go(MaxSurge,*intstr.IntOrString) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentStatus is the most recently observed status of the Deployment.
|
||||
#DeploymentStatus: {
|
||||
// observedGeneration is the generation observed by the deployment controller.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(1,varint,opt)
|
||||
|
||||
// replicas is the total number of non-terminated pods targeted by this deployment (their labels match the selector).
|
||||
// +optional
|
||||
replicas?: int32 @go(Replicas) @protobuf(2,varint,opt)
|
||||
|
||||
// updatedReplicas is the total number of non-terminated pods targeted by this deployment that have the desired template spec.
|
||||
// +optional
|
||||
updatedReplicas?: int32 @go(UpdatedReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition.
|
||||
// +optional
|
||||
readyReplicas?: int32 @go(ReadyReplicas) @protobuf(7,varint,opt)
|
||||
|
||||
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
|
||||
// +optional
|
||||
availableReplicas?: int32 @go(AvailableReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// unavailableReplicas is the total number of unavailable pods targeted by this deployment. This is the total number of
|
||||
// pods that are still required for the deployment to have 100% available capacity. They may
|
||||
// either be pods that are running but not yet available or pods that still have not been created.
|
||||
// +optional
|
||||
unavailableReplicas?: int32 @go(UnavailableReplicas) @protobuf(5,varint,opt)
|
||||
|
||||
// Conditions represent the latest available observations of a deployment's current state.
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#DeploymentCondition] @go(Conditions,[]DeploymentCondition) @protobuf(6,bytes,rep)
|
||||
|
||||
// collisionCount is the count of hash collisions for the Deployment. The Deployment controller uses this
|
||||
// field as a collision avoidance mechanism when it needs to create the name for the
|
||||
// newest ReplicaSet.
|
||||
// +optional
|
||||
collisionCount?: null | int32 @go(CollisionCount,*int32) @protobuf(8,varint,opt)
|
||||
}
|
||||
|
||||
#DeploymentConditionType: string // #enumDeploymentConditionType
|
||||
|
||||
#enumDeploymentConditionType:
|
||||
#DeploymentAvailable |
|
||||
#DeploymentProgressing |
|
||||
#DeploymentReplicaFailure
|
||||
|
||||
// Available means the deployment is available, ie. at least the minimum available
|
||||
// replicas required are up and running for at least minReadySeconds.
|
||||
#DeploymentAvailable: #DeploymentConditionType & "Available"
|
||||
|
||||
// Progressing means the deployment is progressing. Progress for a deployment is
|
||||
// considered when a new replica set is created or adopted, and when new pods scale
|
||||
// up or old pods scale down. Progress is not estimated for paused deployments or
|
||||
// when progressDeadlineSeconds is not specified.
|
||||
#DeploymentProgressing: #DeploymentConditionType & "Progressing"
|
||||
|
||||
// ReplicaFailure is added in a deployment when one of its pods fails to be created
|
||||
// or deleted.
|
||||
#DeploymentReplicaFailure: #DeploymentConditionType & "ReplicaFailure"
|
||||
|
||||
// DeploymentCondition describes the state of a deployment at a certain point.
|
||||
#DeploymentCondition: {
|
||||
// Type of deployment condition.
|
||||
type: #DeploymentConditionType @go(Type) @protobuf(1,bytes,opt,casttype=DeploymentConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// The last time this condition was updated.
|
||||
lastUpdateTime?: metav1.#Time @go(LastUpdateTime) @protobuf(6,bytes,opt)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(7,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentList is a list of Deployments.
|
||||
#DeploymentList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Items is the list of Deployments.
|
||||
items: [...#Deployment] @go(Items,[]Deployment) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1beta2/ControllerRevision. See the
|
||||
// release notes for more information.
|
||||
// ControllerRevision implements an immutable snapshot of state data. Clients
|
||||
// are responsible for serializing and deserializing the objects that contain
|
||||
// their internal state.
|
||||
// Once a ControllerRevision has been successfully created, it can not be updated.
|
||||
// The API Server will fail validation of all requests that attempt to mutate
|
||||
// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both
|
||||
// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However,
|
||||
// it may be subject to name and representation changes in future releases, and clients should not
|
||||
// depend on its stability. It is primarily for internal use by controllers.
|
||||
#ControllerRevision: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// data is the serialized representation of the state.
|
||||
data?: runtime.#RawExtension @go(Data) @protobuf(2,bytes,opt)
|
||||
|
||||
// revision indicates the revision of the state represented by Data.
|
||||
revision: int64 @go(Revision) @protobuf(3,varint,opt)
|
||||
}
|
||||
|
||||
// ControllerRevisionList is a resource containing a list of ControllerRevision objects.
|
||||
#ControllerRevisionList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Items is the list of ControllerRevisions
|
||||
items: [...#ControllerRevision] @go(Items,[]ControllerRevision) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apps/v1beta2
|
||||
|
||||
package v1beta2
|
||||
|
||||
#GroupName: "apps"
|
||||
@@ -0,0 +1,984 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/apps/v1beta2
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
#ControllerRevisionHashLabelKey: "controller-revision-hash"
|
||||
#StatefulSetRevisionLabel: "controller-revision-hash"
|
||||
#DeprecatedRollbackTo: "deprecated.deployment.rollback.to"
|
||||
#DeprecatedTemplateGeneration: "deprecated.daemonset.template.generation"
|
||||
#StatefulSetPodNameLabel: "statefulset.kubernetes.io/pod-name"
|
||||
|
||||
// ScaleSpec describes the attributes of a scale subresource
|
||||
#ScaleSpec: {
|
||||
// desired number of instances for the scaled object.
|
||||
// +optional
|
||||
replicas?: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// ScaleStatus represents the current status of a scale subresource.
|
||||
#ScaleStatus: {
|
||||
// actual number of observed instances of the scaled object.
|
||||
replicas: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
// +optional
|
||||
// +mapType=atomic
|
||||
selector?: {[string]: string} @go(Selector,map[string]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// label selector for pods that should match the replicas count. This is a serializated
|
||||
// version of both map-based and more expressive set-based selectors. This is done to
|
||||
// avoid introspection in the clients. The string will be in the same format as the
|
||||
// query-param syntax. If the target type only supports map-based selectors, both this
|
||||
// field and map-based selector field are populated.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
// +optional
|
||||
targetSelector?: string @go(TargetSelector) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// Scale represents a scaling request for a resource.
|
||||
#Scale: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #ScaleSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
|
||||
// +optional
|
||||
status?: #ScaleStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of StatefulSet is deprecated by apps/v1/StatefulSet. See the release notes for
|
||||
// more information.
|
||||
// StatefulSet represents a set of pods with consistent identities.
|
||||
// Identities are defined as:
|
||||
// - Network: A single stable DNS and hostname.
|
||||
// - Storage: As many VolumeClaims as requested.
|
||||
//
|
||||
// The StatefulSet guarantees that a given network identity will always
|
||||
// map to the same storage identity.
|
||||
#StatefulSet: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec defines the desired identities of pods in this set.
|
||||
// +optional
|
||||
spec?: #StatefulSetSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is the current status of Pods in this StatefulSet. This data
|
||||
// may be out of date by some window of time.
|
||||
// +optional
|
||||
status?: #StatefulSetStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// PodManagementPolicyType defines the policy for creating pods under a stateful set.
|
||||
#PodManagementPolicyType: string // #enumPodManagementPolicyType
|
||||
|
||||
#enumPodManagementPolicyType:
|
||||
#OrderedReadyPodManagement |
|
||||
#ParallelPodManagement
|
||||
|
||||
// OrderedReadyPodManagement will create pods in strictly increasing order on
|
||||
// scale up and strictly decreasing order on scale down, progressing only when
|
||||
// the previous pod is ready or terminated. At most one pod will be changed
|
||||
// at any time.
|
||||
#OrderedReadyPodManagement: #PodManagementPolicyType & "OrderedReady"
|
||||
|
||||
// ParallelPodManagement will create and delete pods as soon as the stateful set
|
||||
// replica count is changed, and will not wait for pods to be ready or complete
|
||||
// termination.
|
||||
#ParallelPodManagement: #PodManagementPolicyType & "Parallel"
|
||||
|
||||
// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet
|
||||
// controller will use to perform updates. It includes any additional parameters
|
||||
// necessary to perform the update for the indicated strategy.
|
||||
#StatefulSetUpdateStrategy: {
|
||||
// Type indicates the type of the StatefulSetUpdateStrategy.
|
||||
// Default is RollingUpdate.
|
||||
// +optional
|
||||
type?: #StatefulSetUpdateStrategyType @go(Type) @protobuf(1,bytes,opt,casttype=StatefulSetStrategyType)
|
||||
|
||||
// RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
|
||||
// +optional
|
||||
rollingUpdate?: null | #RollingUpdateStatefulSetStrategy @go(RollingUpdate,*RollingUpdateStatefulSetStrategy) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetUpdateStrategyType is a string enumeration type that enumerates
|
||||
// all possible update strategies for the StatefulSet controller.
|
||||
#StatefulSetUpdateStrategyType: string // #enumStatefulSetUpdateStrategyType
|
||||
|
||||
#enumStatefulSetUpdateStrategyType:
|
||||
#RollingUpdateStatefulSetStrategyType |
|
||||
#OnDeleteStatefulSetStrategyType
|
||||
|
||||
// RollingUpdateStatefulSetStrategyType indicates that update will be
|
||||
// applied to all Pods in the StatefulSet with respect to the StatefulSet
|
||||
// ordering constraints. When a scale operation is performed with this
|
||||
// strategy, new Pods will be created from the specification version indicated
|
||||
// by the StatefulSet's updateRevision.
|
||||
#RollingUpdateStatefulSetStrategyType: #StatefulSetUpdateStrategyType & "RollingUpdate"
|
||||
|
||||
// OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version
|
||||
// tracking and ordered rolling restarts are disabled. Pods are recreated
|
||||
// from the StatefulSetSpec when they are manually deleted. When a scale
|
||||
// operation is performed with this strategy,specification version indicated
|
||||
// by the StatefulSet's currentRevision.
|
||||
#OnDeleteStatefulSetStrategyType: #StatefulSetUpdateStrategyType & "OnDelete"
|
||||
|
||||
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
|
||||
#RollingUpdateStatefulSetStrategy: {
|
||||
// Partition indicates the ordinal at which the StatefulSet should be partitioned
|
||||
// for updates. During a rolling update, all pods from ordinal Replicas-1 to
|
||||
// Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
|
||||
// This is helpful in being able to do a canary based deployment. The default value is 0.
|
||||
// +optional
|
||||
partition?: null | int32 @go(Partition,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// The maximum number of pods that can be unavailable during the update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// Absolute number is calculated from percentage by rounding up. This can not be 0.
|
||||
// Defaults to 1. This field is alpha-level and is only honored by servers that enable the
|
||||
// MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
|
||||
// Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
|
||||
// will be counted towards MaxUnavailable.
|
||||
// +optional
|
||||
maxUnavailable?: null | intstr.#IntOrString @go(MaxUnavailable,*intstr.IntOrString) @protobuf(2,varint,opt)
|
||||
}
|
||||
|
||||
// PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine
|
||||
// when volumes from the VolumeClaimTemplates will be deleted when the controlling StatefulSet is
|
||||
// deleted or scaled down.
|
||||
#PersistentVolumeClaimRetentionPolicyType: string // #enumPersistentVolumeClaimRetentionPolicyType
|
||||
|
||||
#enumPersistentVolumeClaimRetentionPolicyType:
|
||||
#RetainPersistentVolumeClaimRetentionPolicyType |
|
||||
#RetentionPersistentVolumeClaimRetentionPolicyType
|
||||
|
||||
// RetainPersistentVolumeClaimRetentionPolicyType is the default
|
||||
// PersistentVolumeClaimRetentionPolicy and specifies that
|
||||
// PersistentVolumeClaims associated with StatefulSet VolumeClaimTemplates
|
||||
// will not be deleted.
|
||||
#RetainPersistentVolumeClaimRetentionPolicyType: #PersistentVolumeClaimRetentionPolicyType & "Retain"
|
||||
|
||||
// RetentionPersistentVolumeClaimRetentionPolicyType specifies that
|
||||
// PersistentVolumeClaims associated with StatefulSet VolumeClaimTemplates
|
||||
// will be deleted in the scenario specified in
|
||||
// StatefulSetPersistentVolumeClaimRetentionPolicy.
|
||||
#RetentionPersistentVolumeClaimRetentionPolicyType: #PersistentVolumeClaimRetentionPolicyType & "Delete"
|
||||
|
||||
// StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs
|
||||
// created from the StatefulSet VolumeClaimTemplates.
|
||||
#StatefulSetPersistentVolumeClaimRetentionPolicy: {
|
||||
// WhenDeleted specifies what happens to PVCs created from StatefulSet
|
||||
// VolumeClaimTemplates when the StatefulSet is deleted. The default policy
|
||||
// of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
|
||||
// `Delete` policy causes those PVCs to be deleted.
|
||||
whenDeleted?: #PersistentVolumeClaimRetentionPolicyType @go(WhenDeleted) @protobuf(1,bytes,opt,casttype=PersistentVolumeClaimRetentionPolicyType)
|
||||
|
||||
// WhenScaled specifies what happens to PVCs created from StatefulSet
|
||||
// VolumeClaimTemplates when the StatefulSet is scaled down. The default
|
||||
// policy of `Retain` causes PVCs to not be affected by a scaledown. The
|
||||
// `Delete` policy causes the associated PVCs for any excess pods above
|
||||
// the replica count to be deleted.
|
||||
whenScaled?: #PersistentVolumeClaimRetentionPolicyType @go(WhenScaled) @protobuf(2,bytes,opt,casttype=PersistentVolumeClaimRetentionPolicyType)
|
||||
}
|
||||
|
||||
// StatefulSetOrdinals describes the policy used for replica ordinal assignment
|
||||
// in this StatefulSet.
|
||||
#StatefulSetOrdinals: {
|
||||
// start is the number representing the first replica's index. It may be used
|
||||
// to number replicas from an alternate index (eg: 1-indexed) over the default
|
||||
// 0-indexed names, or to orchestrate progressive movement of replicas from
|
||||
// one StatefulSet to another.
|
||||
// If set, replica indices will be in the range:
|
||||
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
|
||||
// If unset, defaults to 0. Replica indices will be in the range:
|
||||
// [0, .spec.replicas).
|
||||
// +optional
|
||||
start?: int32 @go(Start) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// A StatefulSetSpec is the specification of a StatefulSet.
|
||||
#StatefulSetSpec: {
|
||||
// replicas is the desired number of replicas of the given Template.
|
||||
// These are replicas in the sense that they are instantiations of the
|
||||
// same Template, but individual replicas also have a consistent identity.
|
||||
// If unspecified, defaults to 1.
|
||||
// TODO: Consider a rename of this field.
|
||||
// +optional
|
||||
replicas?: null | int32 @go(Replicas,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is a label query over pods that should match the replica count.
|
||||
// It must match the pod template's labels.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// template is the object that describes the pod that will be created if
|
||||
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
|
||||
// will fulfill this Template, but have a unique identity from the rest
|
||||
// of the StatefulSet. Each pod will be named with the format
|
||||
// <statefulsetname>-<podindex>. For example, a pod in a StatefulSet named
|
||||
// "web" with index number "3" would be named "web-3".
|
||||
// The only allowed template.spec.restartPolicy value is "Always".
|
||||
template: v1.#PodTemplateSpec @go(Template) @protobuf(3,bytes,opt)
|
||||
|
||||
// volumeClaimTemplates is a list of claims that pods are allowed to reference.
|
||||
// The StatefulSet controller is responsible for mapping network identities to
|
||||
// claims in a way that maintains the identity of a pod. Every claim in
|
||||
// this list must have at least one matching (by name) volumeMount in one
|
||||
// container in the template. A claim in this list takes precedence over
|
||||
// any volumes in the template, with the same name.
|
||||
// TODO: Define the behavior if a claim already exists with the same name.
|
||||
// +optional
|
||||
volumeClaimTemplates?: [...v1.#PersistentVolumeClaim] @go(VolumeClaimTemplates,[]v1.PersistentVolumeClaim) @protobuf(4,bytes,rep)
|
||||
|
||||
// serviceName is the name of the service that governs this StatefulSet.
|
||||
// This service must exist before the StatefulSet, and is responsible for
|
||||
// the network identity of the set. Pods get DNS/hostnames that follow the
|
||||
// pattern: pod-specific-string.serviceName.default.svc.cluster.local
|
||||
// where "pod-specific-string" is managed by the StatefulSet controller.
|
||||
serviceName: string @go(ServiceName) @protobuf(5,bytes,opt)
|
||||
|
||||
// podManagementPolicy controls how pods are created during initial scale up,
|
||||
// when replacing pods on nodes, or when scaling down. The default policy is
|
||||
// `OrderedReady`, where pods are created in increasing order (pod-0, then
|
||||
// pod-1, etc) and the controller will wait until each pod is ready before
|
||||
// continuing. When scaling down, the pods are removed in the opposite order.
|
||||
// The alternative policy is `Parallel` which will create pods in parallel
|
||||
// to match the desired scale without waiting, and on scale down will delete
|
||||
// all pods at once.
|
||||
// +optional
|
||||
podManagementPolicy?: #PodManagementPolicyType @go(PodManagementPolicy) @protobuf(6,bytes,opt,casttype=PodManagementPolicyType)
|
||||
|
||||
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
|
||||
// employed to update Pods in the StatefulSet when a revision is made to
|
||||
// Template.
|
||||
updateStrategy?: #StatefulSetUpdateStrategy @go(UpdateStrategy) @protobuf(7,bytes,opt)
|
||||
|
||||
// revisionHistoryLimit is the maximum number of revisions that will
|
||||
// be maintained in the StatefulSet's revision history. The revision history
|
||||
// consists of all revisions not represented by a currently applied
|
||||
// StatefulSetSpec version. The default value is 10.
|
||||
revisionHistoryLimit?: null | int32 @go(RevisionHistoryLimit,*int32) @protobuf(8,varint,opt)
|
||||
|
||||
// Minimum number of seconds for which a newly created pod should be ready
|
||||
// without any of its container crashing for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(9,varint,opt)
|
||||
|
||||
// PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from
|
||||
// the StatefulSet VolumeClaimTemplates. This requires the
|
||||
// StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.
|
||||
// +optional
|
||||
persistentVolumeClaimRetentionPolicy?: null | #StatefulSetPersistentVolumeClaimRetentionPolicy @go(PersistentVolumeClaimRetentionPolicy,*StatefulSetPersistentVolumeClaimRetentionPolicy) @protobuf(10,bytes,opt)
|
||||
|
||||
// ordinals controls the numbering of replica indices in a StatefulSet. The
|
||||
// default ordinals behavior assigns a "0" index to the first replica and
|
||||
// increments the index by one for each additional replica requested. Using
|
||||
// the ordinals field requires the StatefulSetStartOrdinal feature gate to be
|
||||
// enabled, which is beta.
|
||||
// +optional
|
||||
ordinals?: null | #StatefulSetOrdinals @go(Ordinals,*StatefulSetOrdinals) @protobuf(11,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetStatus represents the current state of a StatefulSet.
|
||||
#StatefulSetStatus: {
|
||||
// observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
|
||||
// StatefulSet's generation, which is updated on mutation by the API Server.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(1,varint,opt)
|
||||
|
||||
// replicas is the number of Pods created by the StatefulSet controller.
|
||||
replicas: int32 @go(Replicas) @protobuf(2,varint,opt)
|
||||
|
||||
// readyReplicas is the number of pods created by this StatefulSet controller with a Ready Condition.
|
||||
readyReplicas?: int32 @go(ReadyReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
||||
// indicated by currentRevision.
|
||||
currentReplicas?: int32 @go(CurrentReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
|
||||
// indicated by updateRevision.
|
||||
updatedReplicas?: int32 @go(UpdatedReplicas) @protobuf(5,varint,opt)
|
||||
|
||||
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
|
||||
// sequence [0,currentReplicas).
|
||||
currentRevision?: string @go(CurrentRevision) @protobuf(6,bytes,opt)
|
||||
|
||||
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
|
||||
// [replicas-updatedReplicas,replicas)
|
||||
updateRevision?: string @go(UpdateRevision) @protobuf(7,bytes,opt)
|
||||
|
||||
// collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
|
||||
// uses this field as a collision avoidance mechanism when it needs to create the name for the
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
collisionCount?: null | int32 @go(CollisionCount,*int32) @protobuf(9,varint,opt)
|
||||
|
||||
// Represents the latest available observations of a statefulset's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#StatefulSetCondition] @go(Conditions,[]StatefulSetCondition) @protobuf(10,bytes,rep)
|
||||
|
||||
// Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet.
|
||||
// +optional
|
||||
availableReplicas?: int32 @go(AvailableReplicas) @protobuf(11,varint,opt)
|
||||
}
|
||||
|
||||
#StatefulSetConditionType: string
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
#StatefulSetCondition: {
|
||||
// Type of statefulset condition.
|
||||
type: #StatefulSetConditionType @go(Type) @protobuf(1,bytes,opt,casttype=StatefulSetConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// StatefulSetList is a collection of StatefulSets.
|
||||
#StatefulSetList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
items: [...#StatefulSet] @go(Items,[]StatefulSet) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of Deployment is deprecated by apps/v1/Deployment. See the release notes for
|
||||
// more information.
|
||||
// Deployment enables declarative updates for Pods and ReplicaSets.
|
||||
#Deployment: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Specification of the desired behavior of the Deployment.
|
||||
// +optional
|
||||
spec?: #DeploymentSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Most recently observed status of the Deployment.
|
||||
// +optional
|
||||
status?: #DeploymentStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentSpec is the specification of the desired behavior of the Deployment.
|
||||
#DeploymentSpec: {
|
||||
// Number of desired pods. This is a pointer to distinguish between explicit
|
||||
// zero and not specified. Defaults to 1.
|
||||
// +optional
|
||||
replicas?: null | int32 @go(Replicas,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// Label selector for pods. Existing ReplicaSets whose pods are
|
||||
// selected by this will be the ones affected by this deployment.
|
||||
// It must match the pod template's labels.
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// Template describes the pods that will be created.
|
||||
// The only allowed template.spec.restartPolicy value is "Always".
|
||||
template: v1.#PodTemplateSpec @go(Template) @protobuf(3,bytes,opt)
|
||||
|
||||
// The deployment strategy to use to replace existing pods with new ones.
|
||||
// +optional
|
||||
// +patchStrategy=retainKeys
|
||||
strategy?: #DeploymentStrategy @go(Strategy) @protobuf(4,bytes,opt)
|
||||
|
||||
// Minimum number of seconds for which a newly created pod should be ready
|
||||
// without any of its container crashing, for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(5,varint,opt)
|
||||
|
||||
// The number of old ReplicaSets to retain to allow rollback.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// Defaults to 10.
|
||||
// +optional
|
||||
revisionHistoryLimit?: null | int32 @go(RevisionHistoryLimit,*int32) @protobuf(6,varint,opt)
|
||||
|
||||
// Indicates that the deployment is paused.
|
||||
// +optional
|
||||
paused?: bool @go(Paused) @protobuf(7,varint,opt)
|
||||
|
||||
// The maximum time in seconds for a deployment to make progress before it
|
||||
// is considered to be failed. The deployment controller will continue to
|
||||
// process failed deployments and a condition with a ProgressDeadlineExceeded
|
||||
// reason will be surfaced in the deployment status. Note that progress will
|
||||
// not be estimated during the time a deployment is paused. Defaults to 600s.
|
||||
progressDeadlineSeconds?: null | int32 @go(ProgressDeadlineSeconds,*int32) @protobuf(9,varint,opt)
|
||||
}
|
||||
|
||||
// DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
|
||||
// to existing ReplicaSets (and label key that is added to its pods) to prevent the existing ReplicaSets
|
||||
// to select new pods (and old pods being select by new ReplicaSet).
|
||||
#DefaultDeploymentUniqueLabelKey: "pod-template-hash"
|
||||
|
||||
// DeploymentStrategy describes how to replace existing pods with new ones.
|
||||
#DeploymentStrategy: {
|
||||
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||
// +optional
|
||||
type?: #DeploymentStrategyType @go(Type) @protobuf(1,bytes,opt,casttype=DeploymentStrategyType)
|
||||
|
||||
// Rolling update config params. Present only if DeploymentStrategyType =
|
||||
// RollingUpdate.
|
||||
//---
|
||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||
// to be.
|
||||
// +optional
|
||||
rollingUpdate?: null | #RollingUpdateDeployment @go(RollingUpdate,*RollingUpdateDeployment) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
#DeploymentStrategyType: string // #enumDeploymentStrategyType
|
||||
|
||||
#enumDeploymentStrategyType:
|
||||
#RecreateDeploymentStrategyType |
|
||||
#RollingUpdateDeploymentStrategyType
|
||||
|
||||
// Kill all existing pods before creating new ones.
|
||||
#RecreateDeploymentStrategyType: #DeploymentStrategyType & "Recreate"
|
||||
|
||||
// Replace the old ReplicaSets by new one using rolling update i.e gradually scale down the old ReplicaSets and scale up the new one.
|
||||
#RollingUpdateDeploymentStrategyType: #DeploymentStrategyType & "RollingUpdate"
|
||||
|
||||
// Spec to control the desired behavior of rolling update.
|
||||
#RollingUpdateDeployment: {
|
||||
// The maximum number of pods that can be unavailable during the update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// Absolute number is calculated from percentage by rounding down.
|
||||
// This can not be 0 if MaxSurge is 0.
|
||||
// Defaults to 25%.
|
||||
// Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
|
||||
// immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
|
||||
// can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
|
||||
// that the total number of pods available at all times during the update is at
|
||||
// least 70% of desired pods.
|
||||
// +optional
|
||||
maxUnavailable?: null | intstr.#IntOrString @go(MaxUnavailable,*intstr.IntOrString) @protobuf(1,bytes,opt)
|
||||
|
||||
// The maximum number of pods that can be scheduled above the desired number of
|
||||
// pods.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// This can not be 0 if MaxUnavailable is 0.
|
||||
// Absolute number is calculated from percentage by rounding up.
|
||||
// Defaults to 25%.
|
||||
// Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
|
||||
// the rolling update starts, such that the total number of old and new pods do not exceed
|
||||
// 130% of desired pods. Once old pods have been killed,
|
||||
// new ReplicaSet can be scaled up further, ensuring that total number of pods running
|
||||
// at any time during the update is at most 130% of desired pods.
|
||||
// +optional
|
||||
maxSurge?: null | intstr.#IntOrString @go(MaxSurge,*intstr.IntOrString) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentStatus is the most recently observed status of the Deployment.
|
||||
#DeploymentStatus: {
|
||||
// The generation observed by the deployment controller.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(1,varint,opt)
|
||||
|
||||
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
|
||||
// +optional
|
||||
replicas?: int32 @go(Replicas) @protobuf(2,varint,opt)
|
||||
|
||||
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
|
||||
// +optional
|
||||
updatedReplicas?: int32 @go(UpdatedReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition.
|
||||
// +optional
|
||||
readyReplicas?: int32 @go(ReadyReplicas) @protobuf(7,varint,opt)
|
||||
|
||||
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
|
||||
// +optional
|
||||
availableReplicas?: int32 @go(AvailableReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// Total number of unavailable pods targeted by this deployment. This is the total number of
|
||||
// pods that are still required for the deployment to have 100% available capacity. They may
|
||||
// either be pods that are running but not yet available or pods that still have not been created.
|
||||
// +optional
|
||||
unavailableReplicas?: int32 @go(UnavailableReplicas) @protobuf(5,varint,opt)
|
||||
|
||||
// Represents the latest available observations of a deployment's current state.
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#DeploymentCondition] @go(Conditions,[]DeploymentCondition) @protobuf(6,bytes,rep)
|
||||
|
||||
// Count of hash collisions for the Deployment. The Deployment controller uses this
|
||||
// field as a collision avoidance mechanism when it needs to create the name for the
|
||||
// newest ReplicaSet.
|
||||
// +optional
|
||||
collisionCount?: null | int32 @go(CollisionCount,*int32) @protobuf(8,varint,opt)
|
||||
}
|
||||
|
||||
#DeploymentConditionType: string // #enumDeploymentConditionType
|
||||
|
||||
#enumDeploymentConditionType:
|
||||
#DeploymentAvailable |
|
||||
#DeploymentProgressing |
|
||||
#DeploymentReplicaFailure
|
||||
|
||||
// Available means the deployment is available, ie. at least the minimum available
|
||||
// replicas required are up and running for at least minReadySeconds.
|
||||
#DeploymentAvailable: #DeploymentConditionType & "Available"
|
||||
|
||||
// Progressing means the deployment is progressing. Progress for a deployment is
|
||||
// considered when a new replica set is created or adopted, and when new pods scale
|
||||
// up or old pods scale down. Progress is not estimated for paused deployments or
|
||||
// when progressDeadlineSeconds is not specified.
|
||||
#DeploymentProgressing: #DeploymentConditionType & "Progressing"
|
||||
|
||||
// ReplicaFailure is added in a deployment when one of its pods fails to be created
|
||||
// or deleted.
|
||||
#DeploymentReplicaFailure: #DeploymentConditionType & "ReplicaFailure"
|
||||
|
||||
// DeploymentCondition describes the state of a deployment at a certain point.
|
||||
#DeploymentCondition: {
|
||||
// Type of deployment condition.
|
||||
type: #DeploymentConditionType @go(Type) @protobuf(1,bytes,opt,casttype=DeploymentConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// The last time this condition was updated.
|
||||
lastUpdateTime?: metav1.#Time @go(LastUpdateTime) @protobuf(6,bytes,opt)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(7,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// DeploymentList is a list of Deployments.
|
||||
#DeploymentList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Items is the list of Deployments.
|
||||
items: [...#Deployment] @go(Items,[]Deployment) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.
|
||||
#DaemonSetUpdateStrategy: {
|
||||
// Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate.
|
||||
// +optional
|
||||
type?: #DaemonSetUpdateStrategyType @go(Type) @protobuf(1,bytes,opt)
|
||||
|
||||
// Rolling update config params. Present only if type = "RollingUpdate".
|
||||
//---
|
||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||
// to be. Same as Deployment `strategy.rollingUpdate`.
|
||||
// See https://github.com/kubernetes/kubernetes/issues/35345
|
||||
// +optional
|
||||
rollingUpdate?: null | #RollingUpdateDaemonSet @go(RollingUpdate,*RollingUpdateDaemonSet) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
#DaemonSetUpdateStrategyType: string // #enumDaemonSetUpdateStrategyType
|
||||
|
||||
#enumDaemonSetUpdateStrategyType:
|
||||
#RollingUpdateDaemonSetStrategyType |
|
||||
#OnDeleteDaemonSetStrategyType
|
||||
|
||||
// Replace the old daemons by new ones using rolling update i.e replace them on each node one after the other.
|
||||
#RollingUpdateDaemonSetStrategyType: #DaemonSetUpdateStrategyType & "RollingUpdate"
|
||||
|
||||
// Replace the old daemons only when it's killed
|
||||
#OnDeleteDaemonSetStrategyType: #DaemonSetUpdateStrategyType & "OnDelete"
|
||||
|
||||
// Spec to control the desired behavior of daemon set rolling update.
|
||||
#RollingUpdateDaemonSet: {
|
||||
// The maximum number of DaemonSet pods that can be unavailable during the
|
||||
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
||||
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
||||
// number is calculated from percentage by rounding up.
|
||||
// This cannot be 0 if MaxSurge is 0
|
||||
// Default value is 1.
|
||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||
// can have their pods stopped for an update at any given time. The update
|
||||
// starts by stopping at most 30% of those DaemonSet pods and then brings
|
||||
// up new DaemonSet pods in their place. Once the new pods are available,
|
||||
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
|
||||
// 70% of original number of DaemonSet pods are available at all times during
|
||||
// the update.
|
||||
// +optional
|
||||
maxUnavailable?: null | intstr.#IntOrString @go(MaxUnavailable,*intstr.IntOrString) @protobuf(1,bytes,opt)
|
||||
|
||||
// The maximum number of nodes with an existing available DaemonSet pod that
|
||||
// can have an updated DaemonSet pod during during an update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
// This can not be 0 if MaxUnavailable is 0.
|
||||
// Absolute number is calculated from percentage by rounding up to a minimum of 1.
|
||||
// Default value is 0.
|
||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||
// can have their a new pod created before the old pod is marked as deleted.
|
||||
// The update starts by launching new pods on 30% of nodes. Once an updated
|
||||
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||
// pod is immediatedly created on that node without considering surge limits.
|
||||
// Allowing surge implies the possibility that the resources consumed by the
|
||||
// daemonset on any given node can double if the readiness check fails, and
|
||||
// so resource intensive daemonsets should take into account that they may
|
||||
// cause evictions during disruption.
|
||||
// +optional
|
||||
maxSurge?: null | intstr.#IntOrString @go(MaxSurge,*intstr.IntOrString) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// DaemonSetSpec is the specification of a daemon set.
|
||||
#DaemonSetSpec: {
|
||||
// A label query over pods that are managed by the daemon set.
|
||||
// Must match in order to be controlled.
|
||||
// It must match the pod template's labels.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(1,bytes,opt)
|
||||
|
||||
// An object that describes the pod that will be created.
|
||||
// The DaemonSet will create exactly one copy of this pod on every node
|
||||
// that matches the template's node selector (or on every node if no node
|
||||
// selector is specified).
|
||||
// The only allowed template.spec.restartPolicy value is "Always".
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
|
||||
template: v1.#PodTemplateSpec @go(Template) @protobuf(2,bytes,opt)
|
||||
|
||||
// An update strategy to replace existing DaemonSet pods with new pods.
|
||||
// +optional
|
||||
updateStrategy?: #DaemonSetUpdateStrategy @go(UpdateStrategy) @protobuf(3,bytes,opt)
|
||||
|
||||
// The minimum number of seconds for which a newly created DaemonSet pod should
|
||||
// be ready without any of its container crashing, for it to be considered
|
||||
// available. Defaults to 0 (pod will be considered available as soon as it
|
||||
// is ready).
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(4,varint,opt)
|
||||
|
||||
// The number of old history to retain to allow rollback.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// Defaults to 10.
|
||||
// +optional
|
||||
revisionHistoryLimit?: null | int32 @go(RevisionHistoryLimit,*int32) @protobuf(6,varint,opt)
|
||||
}
|
||||
|
||||
// DaemonSetStatus represents the current status of a daemon set.
|
||||
#DaemonSetStatus: {
|
||||
// The number of nodes that are running at least 1
|
||||
// daemon pod and are supposed to run the daemon pod.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
|
||||
currentNumberScheduled: int32 @go(CurrentNumberScheduled) @protobuf(1,varint,opt)
|
||||
|
||||
// The number of nodes that are running the daemon pod, but are
|
||||
// not supposed to run the daemon pod.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
|
||||
numberMisscheduled: int32 @go(NumberMisscheduled) @protobuf(2,varint,opt)
|
||||
|
||||
// The total number of nodes that should be running the daemon
|
||||
// pod (including nodes correctly running the daemon pod).
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
|
||||
desiredNumberScheduled: int32 @go(DesiredNumberScheduled) @protobuf(3,varint,opt)
|
||||
|
||||
// Total number of nodes that should be running the daemon pod and have one
|
||||
// or more of the daemon pod running with a Ready Condition by passing the readinessProbe.
|
||||
numberReady: int32 @go(NumberReady) @protobuf(4,varint,opt)
|
||||
|
||||
// The most recent generation observed by the daemon set controller.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(5,varint,opt)
|
||||
|
||||
// The total number of nodes that are running updated daemon pod
|
||||
// +optional
|
||||
updatedNumberScheduled?: int32 @go(UpdatedNumberScheduled) @protobuf(6,varint,opt)
|
||||
|
||||
// The number of nodes that should be running the
|
||||
// daemon pod and have one or more of the daemon pod running and
|
||||
// available (ready for at least spec.minReadySeconds)
|
||||
// +optional
|
||||
numberAvailable?: int32 @go(NumberAvailable) @protobuf(7,varint,opt)
|
||||
|
||||
// The number of nodes that should be running the
|
||||
// daemon pod and have none of the daemon pod running and available
|
||||
// (ready for at least spec.minReadySeconds)
|
||||
// +optional
|
||||
numberUnavailable?: int32 @go(NumberUnavailable) @protobuf(8,varint,opt)
|
||||
|
||||
// Count of hash collisions for the DaemonSet. The DaemonSet controller
|
||||
// uses this field as a collision avoidance mechanism when it needs to
|
||||
// create the name for the newest ControllerRevision.
|
||||
// +optional
|
||||
collisionCount?: null | int32 @go(CollisionCount,*int32) @protobuf(9,varint,opt)
|
||||
|
||||
// Represents the latest available observations of a DaemonSet's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#DaemonSetCondition] @go(Conditions,[]DaemonSetCondition) @protobuf(10,bytes,rep)
|
||||
}
|
||||
|
||||
#DaemonSetConditionType: string
|
||||
|
||||
// DaemonSetCondition describes the state of a DaemonSet at a certain point.
|
||||
#DaemonSetCondition: {
|
||||
// Type of DaemonSet condition.
|
||||
type: #DaemonSetConditionType @go(Type) @protobuf(1,bytes,opt,casttype=DaemonSetConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of DaemonSet is deprecated by apps/v1/DaemonSet. See the release notes for
|
||||
// more information.
|
||||
// DaemonSet represents the configuration of a daemon set.
|
||||
#DaemonSet: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// The desired behavior of this daemon set.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
spec?: #DaemonSetSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// The current status of this daemon set. This data may be
|
||||
// out of date by some window of time.
|
||||
// Populated by the system.
|
||||
// Read-only.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
status?: #DaemonSetStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// DefaultDaemonSetUniqueLabelKey is the default label key that is added
|
||||
// to existing DaemonSet pods to distinguish between old and new
|
||||
// DaemonSet pods during DaemonSet template updates.
|
||||
#DefaultDaemonSetUniqueLabelKey: "controller-revision-hash"
|
||||
|
||||
// DaemonSetList is a collection of daemon sets.
|
||||
#DaemonSetList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// A list of daemon sets.
|
||||
items: [...#DaemonSet] @go(Items,[]DaemonSet) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1/ReplicaSet. See the release notes for
|
||||
// more information.
|
||||
// ReplicaSet ensures that a specified number of pod replicas are running at any given time.
|
||||
#ReplicaSet: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// If the Labels of a ReplicaSet are empty, they are defaulted to
|
||||
// be the same as the Pod(s) that the ReplicaSet manages.
|
||||
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec defines the specification of the desired behavior of the ReplicaSet.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
spec?: #ReplicaSetSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is the most recently observed status of the ReplicaSet.
|
||||
// This data may be out of date by some window of time.
|
||||
// Populated by the system.
|
||||
// Read-only.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +optional
|
||||
status?: #ReplicaSetStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ReplicaSetList is a collection of ReplicaSets.
|
||||
#ReplicaSetList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// List of ReplicaSets.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
|
||||
items: [...#ReplicaSet] @go(Items,[]ReplicaSet) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// ReplicaSetSpec is the specification of a ReplicaSet.
|
||||
#ReplicaSetSpec: {
|
||||
// Replicas is the number of desired replicas.
|
||||
// This is a pointer to distinguish between explicit zero and unspecified.
|
||||
// Defaults to 1.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
|
||||
// +optional
|
||||
replicas?: null | int32 @go(Replicas,*int32) @protobuf(1,varint,opt)
|
||||
|
||||
// Minimum number of seconds for which a newly created pod should be ready
|
||||
// without any of its container crashing, for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
// +optional
|
||||
minReadySeconds?: int32 @go(MinReadySeconds) @protobuf(4,varint,opt)
|
||||
|
||||
// Selector is a label query over pods that should match the replica count.
|
||||
// Label keys and values that must match in order to be controlled by this replica set.
|
||||
// It must match the pod template's labels.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// Template is the object that describes the pod that will be created if
|
||||
// insufficient replicas are detected.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
|
||||
// +optional
|
||||
template?: v1.#PodTemplateSpec @go(Template) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ReplicaSetStatus represents the current status of a ReplicaSet.
|
||||
#ReplicaSetStatus: {
|
||||
// Replicas is the most recently observed number of replicas.
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
|
||||
replicas: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
|
||||
// The number of pods that have labels matching the labels of the pod template of the replicaset.
|
||||
// +optional
|
||||
fullyLabeledReplicas?: int32 @go(FullyLabeledReplicas) @protobuf(2,varint,opt)
|
||||
|
||||
// readyReplicas is the number of pods targeted by this ReplicaSet controller with a Ready Condition.
|
||||
// +optional
|
||||
readyReplicas?: int32 @go(ReadyReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// The number of available replicas (ready for at least minReadySeconds) for this replica set.
|
||||
// +optional
|
||||
availableReplicas?: int32 @go(AvailableReplicas) @protobuf(5,varint,opt)
|
||||
|
||||
// ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
|
||||
// +optional
|
||||
observedGeneration?: int64 @go(ObservedGeneration) @protobuf(3,varint,opt)
|
||||
|
||||
// Represents the latest available observations of a replica set's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
conditions?: [...#ReplicaSetCondition] @go(Conditions,[]ReplicaSetCondition) @protobuf(6,bytes,rep)
|
||||
}
|
||||
|
||||
#ReplicaSetConditionType: string // #enumReplicaSetConditionType
|
||||
|
||||
#enumReplicaSetConditionType:
|
||||
#ReplicaSetReplicaFailure
|
||||
|
||||
// ReplicaSetReplicaFailure is added in a replica set when one of its pods fails to be created
|
||||
// due to insufficient quota, limit ranges, pod security policy, node selectors, etc. or deleted
|
||||
// due to kubelet being down or finalizers are failing.
|
||||
#ReplicaSetReplicaFailure: #ReplicaSetConditionType & "ReplicaFailure"
|
||||
|
||||
// ReplicaSetCondition describes the state of a replica set at a certain point.
|
||||
#ReplicaSetCondition: {
|
||||
// Type of replica set condition.
|
||||
type: #ReplicaSetConditionType @go(Type) @protobuf(1,bytes,opt,casttype=ReplicaSetConditionType)
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes,opt,casttype=k8s.io/api/core/v1.ConditionStatus)
|
||||
|
||||
// The last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1/ControllerRevision. See the
|
||||
// release notes for more information.
|
||||
// ControllerRevision implements an immutable snapshot of state data. Clients
|
||||
// are responsible for serializing and deserializing the objects that contain
|
||||
// their internal state.
|
||||
// Once a ControllerRevision has been successfully created, it can not be updated.
|
||||
// The API Server will fail validation of all requests that attempt to mutate
|
||||
// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both
|
||||
// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However,
|
||||
// it may be subject to name and representation changes in future releases, and clients should not
|
||||
// depend on its stability. It is primarily for internal use by controllers.
|
||||
#ControllerRevision: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Data is the serialized representation of the state.
|
||||
data?: runtime.#RawExtension @go(Data) @protobuf(2,bytes,opt)
|
||||
|
||||
// Revision indicates the revision of the state represented by Data.
|
||||
revision: int64 @go(Revision) @protobuf(3,varint,opt)
|
||||
}
|
||||
|
||||
// ControllerRevisionList is a resource containing a list of ControllerRevision objects.
|
||||
#ControllerRevisionList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Items is the list of ControllerRevisions
|
||||
items: [...#ControllerRevision] @go(Items,[]ControllerRevision) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1
|
||||
|
||||
package v1
|
||||
|
||||
#GroupName: "authentication.k8s.io"
|
||||
@@ -0,0 +1,206 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
// ImpersonateUserHeader is used to impersonate a particular user during an API server request
|
||||
#ImpersonateUserHeader: "Impersonate-User"
|
||||
|
||||
// ImpersonateGroupHeader is used to impersonate a particular group during an API server request.
|
||||
// It can be repeated multiplied times for multiple groups.
|
||||
#ImpersonateGroupHeader: "Impersonate-Group"
|
||||
|
||||
// ImpersonateUIDHeader is used to impersonate a particular UID during an API server request
|
||||
#ImpersonateUIDHeader: "Impersonate-Uid"
|
||||
|
||||
// ImpersonateUserExtraHeaderPrefix is a prefix for any header used to impersonate an entry in the
|
||||
// extra map[string][]string for user.Info. The key will be every after the prefix.
|
||||
// It can be repeated multiplied times for multiple map keys and the same key can be repeated multiple
|
||||
// times to have multiple elements in the slice under a single key
|
||||
#ImpersonateUserExtraHeaderPrefix: "Impersonate-Extra-"
|
||||
|
||||
// TokenReview attempts to authenticate a token to a known user.
|
||||
// Note: TokenReview requests may be cached by the webhook token authenticator
|
||||
// plugin in the kube-apiserver.
|
||||
#TokenReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated
|
||||
spec: #TokenReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request can be authenticated.
|
||||
// +optional
|
||||
status?: #TokenReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// TokenReviewSpec is a description of the token authentication request.
|
||||
#TokenReviewSpec: {
|
||||
// Token is the opaque bearer token.
|
||||
// +optional
|
||||
token?: string @go(Token) @protobuf(1,bytes,opt)
|
||||
|
||||
// Audiences is a list of the identifiers that the resource server presented
|
||||
// with the token identifies as. Audience-aware token authenticators will
|
||||
// verify that the token was intended for at least one of the audiences in
|
||||
// this list. If no audiences are provided, the audience will default to the
|
||||
// audience of the Kubernetes apiserver.
|
||||
// +optional
|
||||
audiences?: [...string] @go(Audiences,[]string) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// TokenReviewStatus is the result of the token authentication request.
|
||||
#TokenReviewStatus: {
|
||||
// Authenticated indicates that the token was associated with a known user.
|
||||
// +optional
|
||||
authenticated?: bool @go(Authenticated) @protobuf(1,varint,opt)
|
||||
|
||||
// User is the UserInfo associated with the provided token.
|
||||
// +optional
|
||||
user?: #UserInfo @go(User) @protobuf(2,bytes,opt)
|
||||
|
||||
// Audiences are audience identifiers chosen by the authenticator that are
|
||||
// compatible with both the TokenReview and token. An identifier is any
|
||||
// identifier in the intersection of the TokenReviewSpec audiences and the
|
||||
// token's audiences. A client of the TokenReview API that sets the
|
||||
// spec.audiences field should validate that a compatible audience identifier
|
||||
// is returned in the status.audiences field to ensure that the TokenReview
|
||||
// server is audience aware. If a TokenReview returns an empty
|
||||
// status.audience field where status.authenticated is "true", the token is
|
||||
// valid against the audience of the Kubernetes API server.
|
||||
// +optional
|
||||
audiences?: [...string] @go(Audiences,[]string) @protobuf(4,bytes,rep)
|
||||
|
||||
// Error indicates that the token couldn't be checked
|
||||
// +optional
|
||||
error?: string @go(Error) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// UserInfo holds the information about the user needed to implement the
|
||||
// user.Info interface.
|
||||
#UserInfo: {
|
||||
// The name that uniquely identifies this user among all active users.
|
||||
// +optional
|
||||
username?: string @go(Username) @protobuf(1,bytes,opt)
|
||||
|
||||
// A unique value that identifies this user across time. If this user is
|
||||
// deleted and another user by the same name is added, they will have
|
||||
// different UIDs.
|
||||
// +optional
|
||||
uid?: string @go(UID) @protobuf(2,bytes,opt)
|
||||
|
||||
// The names of groups this user is a part of.
|
||||
// +optional
|
||||
groups?: [...string] @go(Groups,[]string) @protobuf(3,bytes,rep)
|
||||
|
||||
// Any additional information provided by the authenticator.
|
||||
// +optional
|
||||
extra?: {[string]: #ExtraValue} @go(Extra,map[string]ExtraValue) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// ExtraValue masks the value so protobuf can generate
|
||||
// +protobuf.nullable=true
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
#ExtraValue: [...string]
|
||||
|
||||
// TokenRequest requests a token for a given service account.
|
||||
#TokenRequest: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated
|
||||
spec: #TokenRequestSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the token can be authenticated.
|
||||
// +optional
|
||||
status?: #TokenRequestStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// TokenRequestSpec contains client provided parameters of a token request.
|
||||
#TokenRequestSpec: {
|
||||
// Audiences are the intendend audiences of the token. A recipient of a
|
||||
// token must identify themself with an identifier in the list of
|
||||
// audiences of the token, and otherwise should reject the token. A
|
||||
// token issued for multiple audiences may be used to authenticate
|
||||
// against any of the audiences listed but implies a high degree of
|
||||
// trust between the target audiences.
|
||||
audiences: [...string] @go(Audiences,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// ExpirationSeconds is the requested duration of validity of the request. The
|
||||
// token issuer may return a token with a different validity duration so a
|
||||
// client needs to check the 'expiration' field in a response.
|
||||
// +optional
|
||||
expirationSeconds?: null | int64 @go(ExpirationSeconds,*int64) @protobuf(4,varint,opt)
|
||||
|
||||
// BoundObjectRef is a reference to an object that the token will be bound to.
|
||||
// The token will only be valid for as long as the bound object exists.
|
||||
// NOTE: The API server's TokenReview endpoint will validate the
|
||||
// BoundObjectRef, but other audiences may not. Keep ExpirationSeconds
|
||||
// small if you want prompt revocation.
|
||||
// +optional
|
||||
boundObjectRef?: null | #BoundObjectReference @go(BoundObjectRef,*BoundObjectReference) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// TokenRequestStatus is the result of a token request.
|
||||
#TokenRequestStatus: {
|
||||
// Token is the opaque bearer token.
|
||||
token: string @go(Token) @protobuf(1,bytes,opt)
|
||||
|
||||
// ExpirationTimestamp is the time of expiration of the returned token.
|
||||
expirationTimestamp: metav1.#Time @go(ExpirationTimestamp) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// BoundObjectReference is a reference to an object that a token is bound to.
|
||||
#BoundObjectReference: {
|
||||
// Kind of the referent. Valid kinds are 'Pod' and 'Secret'.
|
||||
// +optional
|
||||
kind?: string @go(Kind) @protobuf(1,bytes,opt)
|
||||
|
||||
// API version of the referent.
|
||||
// +optional
|
||||
apiVersion?: string @go(APIVersion) @protobuf(2,bytes,opt)
|
||||
|
||||
// Name of the referent.
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(3,bytes,opt)
|
||||
|
||||
// UID of the referent.
|
||||
// +optional
|
||||
uid?: types.#UID @go(UID) @protobuf(4,bytes,opt,name=uID,casttype=k8s.io/apimachinery/pkg/types.UID)
|
||||
}
|
||||
|
||||
// SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request.
|
||||
// When using impersonation, users will receive the user info of the user being impersonated. If impersonation or
|
||||
// request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
|
||||
#SelfSubjectReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Status is filled in by the server with the user attributes.
|
||||
status?: #SelfSubjectReviewStatus @go(Status) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.
|
||||
#SelfSubjectReviewStatus: {
|
||||
// User attributes of the user making this request.
|
||||
// +optional
|
||||
userInfo?: #UserInfo @go(UserInfo) @protobuf(1,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
#GroupName: "authentication.k8s.io"
|
||||
@@ -0,0 +1,32 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1alpha1
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/api/authentication/v1"
|
||||
)
|
||||
|
||||
// SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request.
|
||||
// When using impersonation, users will receive the user info of the user being impersonated. If impersonation or
|
||||
// request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
|
||||
#SelfSubjectReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Status is filled in by the server with the user attributes.
|
||||
status?: #SelfSubjectReviewStatus @go(Status) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.
|
||||
#SelfSubjectReviewStatus: {
|
||||
// User attributes of the user making this request.
|
||||
// +optional
|
||||
userInfo?: v1.#UserInfo @go(UserInfo) @protobuf(1,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
#GroupName: "authentication.k8s.io"
|
||||
@@ -0,0 +1,120 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authentication/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/api/authentication/v1"
|
||||
)
|
||||
|
||||
// TokenReview attempts to authenticate a token to a known user.
|
||||
// Note: TokenReview requests may be cached by the webhook token authenticator
|
||||
// plugin in the kube-apiserver.
|
||||
#TokenReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated
|
||||
spec: #TokenReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the token can be authenticated.
|
||||
// +optional
|
||||
status?: #TokenReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// TokenReviewSpec is a description of the token authentication request.
|
||||
#TokenReviewSpec: {
|
||||
// Token is the opaque bearer token.
|
||||
// +optional
|
||||
token?: string @go(Token) @protobuf(1,bytes,opt)
|
||||
|
||||
// Audiences is a list of the identifiers that the resource server presented
|
||||
// with the token identifies as. Audience-aware token authenticators will
|
||||
// verify that the token was intended for at least one of the audiences in
|
||||
// this list. If no audiences are provided, the audience will default to the
|
||||
// audience of the Kubernetes apiserver.
|
||||
// +optional
|
||||
audiences?: [...string] @go(Audiences,[]string) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// TokenReviewStatus is the result of the token authentication request.
|
||||
#TokenReviewStatus: {
|
||||
// Authenticated indicates that the token was associated with a known user.
|
||||
// +optional
|
||||
authenticated?: bool @go(Authenticated) @protobuf(1,varint,opt)
|
||||
|
||||
// User is the UserInfo associated with the provided token.
|
||||
// +optional
|
||||
user?: #UserInfo @go(User) @protobuf(2,bytes,opt)
|
||||
|
||||
// Audiences are audience identifiers chosen by the authenticator that are
|
||||
// compatible with both the TokenReview and token. An identifier is any
|
||||
// identifier in the intersection of the TokenReviewSpec audiences and the
|
||||
// token's audiences. A client of the TokenReview API that sets the
|
||||
// spec.audiences field should validate that a compatible audience identifier
|
||||
// is returned in the status.audiences field to ensure that the TokenReview
|
||||
// server is audience aware. If a TokenReview returns an empty
|
||||
// status.audience field where status.authenticated is "true", the token is
|
||||
// valid against the audience of the Kubernetes API server.
|
||||
// +optional
|
||||
audiences?: [...string] @go(Audiences,[]string) @protobuf(4,bytes,rep)
|
||||
|
||||
// Error indicates that the token couldn't be checked
|
||||
// +optional
|
||||
error?: string @go(Error) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// UserInfo holds the information about the user needed to implement the
|
||||
// user.Info interface.
|
||||
#UserInfo: {
|
||||
// The name that uniquely identifies this user among all active users.
|
||||
// +optional
|
||||
username?: string @go(Username) @protobuf(1,bytes,opt)
|
||||
|
||||
// A unique value that identifies this user across time. If this user is
|
||||
// deleted and another user by the same name is added, they will have
|
||||
// different UIDs.
|
||||
// +optional
|
||||
uid?: string @go(UID) @protobuf(2,bytes,opt)
|
||||
|
||||
// The names of groups this user is a part of.
|
||||
// +optional
|
||||
groups?: [...string] @go(Groups,[]string) @protobuf(3,bytes,rep)
|
||||
|
||||
// Any additional information provided by the authenticator.
|
||||
// +optional
|
||||
extra?: {[string]: #ExtraValue} @go(Extra,map[string]ExtraValue) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// ExtraValue masks the value so protobuf can generate
|
||||
// +protobuf.nullable=true
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
#ExtraValue: [...string]
|
||||
|
||||
// SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request.
|
||||
// When using impersonation, users will receive the user info of the user being impersonated. If impersonation or
|
||||
// request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
|
||||
#SelfSubjectReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Status is filled in by the server with the user attributes.
|
||||
status?: #SelfSubjectReviewStatus @go(Status) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.
|
||||
#SelfSubjectReviewStatus: {
|
||||
// User attributes of the user making this request.
|
||||
// +optional
|
||||
userInfo?: v1.#UserInfo @go(UserInfo) @protobuf(1,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authorization/v1
|
||||
|
||||
package v1
|
||||
|
||||
#GroupName: "authorization.k8s.io"
|
||||
@@ -0,0 +1,262 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authorization/v1
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// SubjectAccessReview checks whether or not a user or group can perform an action.
|
||||
#SubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated
|
||||
spec: #SubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a
|
||||
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able
|
||||
// to check whether they can perform an action
|
||||
#SelfSubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated. user and groups must be empty
|
||||
spec: #SelfSubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
|
||||
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
|
||||
// checking.
|
||||
#LocalSubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
|
||||
// you made the request against. If empty, it is defaulted.
|
||||
spec: #SubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
|
||||
#ResourceAttributes: {
|
||||
// Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces
|
||||
// "" (empty) is defaulted for LocalSubjectAccessReviews
|
||||
// "" (empty) is empty for cluster-scoped resources
|
||||
// "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
|
||||
// +optional
|
||||
namespace?: string @go(Namespace) @protobuf(1,bytes,opt)
|
||||
|
||||
// Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all.
|
||||
// +optional
|
||||
verb?: string @go(Verb) @protobuf(2,bytes,opt)
|
||||
|
||||
// Group is the API Group of the Resource. "*" means all.
|
||||
// +optional
|
||||
group?: string @go(Group) @protobuf(3,bytes,opt)
|
||||
|
||||
// Version is the API Version of the Resource. "*" means all.
|
||||
// +optional
|
||||
version?: string @go(Version) @protobuf(4,bytes,opt)
|
||||
|
||||
// Resource is one of the existing resource types. "*" means all.
|
||||
// +optional
|
||||
resource?: string @go(Resource) @protobuf(5,bytes,opt)
|
||||
|
||||
// Subresource is one of the existing resource types. "" means none.
|
||||
// +optional
|
||||
subresource?: string @go(Subresource) @protobuf(6,bytes,opt)
|
||||
|
||||
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(7,bytes,opt)
|
||||
}
|
||||
|
||||
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
|
||||
#NonResourceAttributes: {
|
||||
// Path is the URL path of the request
|
||||
// +optional
|
||||
path?: string @go(Path) @protobuf(1,bytes,opt)
|
||||
|
||||
// Verb is the standard HTTP verb
|
||||
// +optional
|
||||
verb?: string @go(Verb) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes
|
||||
// and NonResourceAuthorizationAttributes must be set
|
||||
#SubjectAccessReviewSpec: {
|
||||
// ResourceAuthorizationAttributes describes information for a resource access request
|
||||
// +optional
|
||||
resourceAttributes?: null | #ResourceAttributes @go(ResourceAttributes,*ResourceAttributes) @protobuf(1,bytes,opt)
|
||||
|
||||
// NonResourceAttributes describes information for a non-resource access request
|
||||
// +optional
|
||||
nonResourceAttributes?: null | #NonResourceAttributes @go(NonResourceAttributes,*NonResourceAttributes) @protobuf(2,bytes,opt)
|
||||
|
||||
// User is the user you're testing for.
|
||||
// If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups
|
||||
// +optional
|
||||
user?: string @go(User) @protobuf(3,bytes,opt)
|
||||
|
||||
// Groups is the groups you're testing for.
|
||||
// +optional
|
||||
groups?: [...string] @go(Groups,[]string) @protobuf(4,bytes,rep)
|
||||
|
||||
// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
|
||||
// it needs a reflection here.
|
||||
// +optional
|
||||
extra?: {[string]: #ExtraValue} @go(Extra,map[string]ExtraValue) @protobuf(5,bytes,rep)
|
||||
|
||||
// UID information about the requesting user.
|
||||
// +optional
|
||||
uid?: string @go(UID) @protobuf(6,bytes,opt)
|
||||
}
|
||||
|
||||
// ExtraValue masks the value so protobuf can generate
|
||||
// +protobuf.nullable=true
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
#ExtraValue: [...string]
|
||||
|
||||
// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes
|
||||
// and NonResourceAuthorizationAttributes must be set
|
||||
#SelfSubjectAccessReviewSpec: {
|
||||
// ResourceAuthorizationAttributes describes information for a resource access request
|
||||
// +optional
|
||||
resourceAttributes?: null | #ResourceAttributes @go(ResourceAttributes,*ResourceAttributes) @protobuf(1,bytes,opt)
|
||||
|
||||
// NonResourceAttributes describes information for a non-resource access request
|
||||
// +optional
|
||||
nonResourceAttributes?: null | #NonResourceAttributes @go(NonResourceAttributes,*NonResourceAttributes) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectAccessReviewStatus
|
||||
#SubjectAccessReviewStatus: {
|
||||
// Allowed is required. True if the action would be allowed, false otherwise.
|
||||
allowed: bool @go(Allowed) @protobuf(1,varint,opt)
|
||||
|
||||
// Denied is optional. True if the action would be denied, otherwise
|
||||
// false. If both allowed is false and denied is false, then the
|
||||
// authorizer has no opinion on whether to authorize the action. Denied
|
||||
// may not be true if Allowed is true.
|
||||
// +optional
|
||||
denied?: bool @go(Denied) @protobuf(4,varint,opt)
|
||||
|
||||
// Reason is optional. It indicates why a request was allowed or denied.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(2,bytes,opt)
|
||||
|
||||
// EvaluationError is an indication that some error occurred during the authorization check.
|
||||
// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.
|
||||
// For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.
|
||||
// +optional
|
||||
evaluationError?: string @go(EvaluationError) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.
|
||||
// The returned list of actions may be incomplete depending on the server's authorization mode,
|
||||
// and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions,
|
||||
// or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to
|
||||
// drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns.
|
||||
// SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.
|
||||
#SelfSubjectRulesReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated.
|
||||
spec: #SelfSubjectRulesReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates the set of actions a user can perform.
|
||||
// +optional
|
||||
status?: #SubjectRulesReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.
|
||||
#SelfSubjectRulesReviewSpec: {
|
||||
// Namespace to evaluate rules for. Required.
|
||||
namespace?: string @go(Namespace) @protobuf(1,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on
|
||||
// the set of authorizers the server is configured with and any errors experienced during evaluation.
|
||||
// Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission,
|
||||
// even if that list is incomplete.
|
||||
#SubjectRulesReviewStatus: {
|
||||
// ResourceRules is the list of actions the subject is allowed to perform on resources.
|
||||
// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
|
||||
resourceRules: [...#ResourceRule] @go(ResourceRules,[]ResourceRule) @protobuf(1,bytes,rep)
|
||||
|
||||
// NonResourceRules is the list of actions the subject is allowed to perform on non-resources.
|
||||
// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
|
||||
nonResourceRules: [...#NonResourceRule] @go(NonResourceRules,[]NonResourceRule) @protobuf(2,bytes,rep)
|
||||
|
||||
// Incomplete is true when the rules returned by this call are incomplete. This is most commonly
|
||||
// encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation.
|
||||
incomplete: bool @go(Incomplete) @protobuf(3,bytes,rep)
|
||||
|
||||
// EvaluationError can appear in combination with Rules. It indicates an error occurred during
|
||||
// rule evaluation, such as an authorizer that doesn't support rule evaluation, and that
|
||||
// ResourceRules and/or NonResourceRules may be incomplete.
|
||||
// +optional
|
||||
evaluationError?: string @go(EvaluationError) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant,
|
||||
// may contain duplicates, and possibly be incomplete.
|
||||
#ResourceRule: {
|
||||
// Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all.
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
|
||||
// the enumerated resources in any API group will be allowed. "*" means all.
|
||||
// +optional
|
||||
apiGroups?: [...string] @go(APIGroups,[]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups.
|
||||
// "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups.
|
||||
// +optional
|
||||
resources?: [...string] @go(Resources,[]string) @protobuf(3,bytes,rep)
|
||||
|
||||
// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all.
|
||||
// +optional
|
||||
resourceNames?: [...string] @go(ResourceNames,[]string) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// NonResourceRule holds information that describes a rule for the non-resource
|
||||
#NonResourceRule: {
|
||||
// Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all.
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full,
|
||||
// final step in the path. "*" means all.
|
||||
// +optional
|
||||
nonResourceURLs?: [...string] @go(NonResourceURLs,[]string) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authorization/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
#GroupName: "authorization.k8s.io"
|
||||
@@ -0,0 +1,262 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/authorization/v1beta1
|
||||
|
||||
package v1beta1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// SubjectAccessReview checks whether or not a user or group can perform an action.
|
||||
#SubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated
|
||||
spec: #SubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a
|
||||
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able
|
||||
// to check whether they can perform an action
|
||||
#SelfSubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated. user and groups must be empty
|
||||
spec: #SelfSubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
|
||||
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
|
||||
// checking.
|
||||
#LocalSubjectAccessReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
|
||||
// you made the request against. If empty, it is defaulted.
|
||||
spec: #SubjectAccessReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates whether the request is allowed or not
|
||||
// +optional
|
||||
status?: #SubjectAccessReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
|
||||
#ResourceAttributes: {
|
||||
// Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces
|
||||
// "" (empty) is defaulted for LocalSubjectAccessReviews
|
||||
// "" (empty) is empty for cluster-scoped resources
|
||||
// "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
|
||||
// +optional
|
||||
namespace?: string @go(Namespace) @protobuf(1,bytes,opt)
|
||||
|
||||
// Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all.
|
||||
// +optional
|
||||
verb?: string @go(Verb) @protobuf(2,bytes,opt)
|
||||
|
||||
// Group is the API Group of the Resource. "*" means all.
|
||||
// +optional
|
||||
group?: string @go(Group) @protobuf(3,bytes,opt)
|
||||
|
||||
// Version is the API Version of the Resource. "*" means all.
|
||||
// +optional
|
||||
version?: string @go(Version) @protobuf(4,bytes,opt)
|
||||
|
||||
// Resource is one of the existing resource types. "*" means all.
|
||||
// +optional
|
||||
resource?: string @go(Resource) @protobuf(5,bytes,opt)
|
||||
|
||||
// Subresource is one of the existing resource types. "" means none.
|
||||
// +optional
|
||||
subresource?: string @go(Subresource) @protobuf(6,bytes,opt)
|
||||
|
||||
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
|
||||
// +optional
|
||||
name?: string @go(Name) @protobuf(7,bytes,opt)
|
||||
}
|
||||
|
||||
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
|
||||
#NonResourceAttributes: {
|
||||
// Path is the URL path of the request
|
||||
// +optional
|
||||
path?: string @go(Path) @protobuf(1,bytes,opt)
|
||||
|
||||
// Verb is the standard HTTP verb
|
||||
// +optional
|
||||
verb?: string @go(Verb) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes
|
||||
// and NonResourceAuthorizationAttributes must be set
|
||||
#SubjectAccessReviewSpec: {
|
||||
// ResourceAuthorizationAttributes describes information for a resource access request
|
||||
// +optional
|
||||
resourceAttributes?: null | #ResourceAttributes @go(ResourceAttributes,*ResourceAttributes) @protobuf(1,bytes,opt)
|
||||
|
||||
// NonResourceAttributes describes information for a non-resource access request
|
||||
// +optional
|
||||
nonResourceAttributes?: null | #NonResourceAttributes @go(NonResourceAttributes,*NonResourceAttributes) @protobuf(2,bytes,opt)
|
||||
|
||||
// User is the user you're testing for.
|
||||
// If you specify "User" but not "Group", then is it interpreted as "What if User were not a member of any groups
|
||||
// +optional
|
||||
user?: string @go(User) @protobuf(3,bytes,opt)
|
||||
|
||||
// Groups is the groups you're testing for.
|
||||
// +optional
|
||||
group?: [...string] @go(Groups,[]string) @protobuf(4,bytes,rep)
|
||||
|
||||
// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
|
||||
// it needs a reflection here.
|
||||
// +optional
|
||||
extra?: {[string]: #ExtraValue} @go(Extra,map[string]ExtraValue) @protobuf(5,bytes,rep)
|
||||
|
||||
// UID information about the requesting user.
|
||||
// +optional
|
||||
uid?: string @go(UID) @protobuf(6,bytes,opt)
|
||||
}
|
||||
|
||||
// ExtraValue masks the value so protobuf can generate
|
||||
// +protobuf.nullable=true
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
#ExtraValue: [...string]
|
||||
|
||||
// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes
|
||||
// and NonResourceAuthorizationAttributes must be set
|
||||
#SelfSubjectAccessReviewSpec: {
|
||||
// ResourceAuthorizationAttributes describes information for a resource access request
|
||||
// +optional
|
||||
resourceAttributes?: null | #ResourceAttributes @go(ResourceAttributes,*ResourceAttributes) @protobuf(1,bytes,opt)
|
||||
|
||||
// NonResourceAttributes describes information for a non-resource access request
|
||||
// +optional
|
||||
nonResourceAttributes?: null | #NonResourceAttributes @go(NonResourceAttributes,*NonResourceAttributes) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectAccessReviewStatus
|
||||
#SubjectAccessReviewStatus: {
|
||||
// Allowed is required. True if the action would be allowed, false otherwise.
|
||||
allowed: bool @go(Allowed) @protobuf(1,varint,opt)
|
||||
|
||||
// Denied is optional. True if the action would be denied, otherwise
|
||||
// false. If both allowed is false and denied is false, then the
|
||||
// authorizer has no opinion on whether to authorize the action. Denied
|
||||
// may not be true if Allowed is true.
|
||||
// +optional
|
||||
denied?: bool @go(Denied) @protobuf(4,varint,opt)
|
||||
|
||||
// Reason is optional. It indicates why a request was allowed or denied.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(2,bytes,opt)
|
||||
|
||||
// EvaluationError is an indication that some error occurred during the authorization check.
|
||||
// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.
|
||||
// For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.
|
||||
// +optional
|
||||
evaluationError?: string @go(EvaluationError) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.
|
||||
// The returned list of actions may be incomplete depending on the server's authorization mode,
|
||||
// and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions,
|
||||
// or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to
|
||||
// drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns.
|
||||
// SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.
|
||||
#SelfSubjectRulesReview: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// Spec holds information about the request being evaluated.
|
||||
spec: #SelfSubjectRulesReviewSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// Status is filled in by the server and indicates the set of actions a user can perform.
|
||||
// +optional
|
||||
status?: #SubjectRulesReviewStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.
|
||||
#SelfSubjectRulesReviewSpec: {
|
||||
// Namespace to evaluate rules for. Required.
|
||||
namespace?: string @go(Namespace) @protobuf(1,bytes,opt)
|
||||
}
|
||||
|
||||
// SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on
|
||||
// the set of authorizers the server is configured with and any errors experienced during evaluation.
|
||||
// Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission,
|
||||
// even if that list is incomplete.
|
||||
#SubjectRulesReviewStatus: {
|
||||
// ResourceRules is the list of actions the subject is allowed to perform on resources.
|
||||
// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
|
||||
resourceRules: [...#ResourceRule] @go(ResourceRules,[]ResourceRule) @protobuf(1,bytes,rep)
|
||||
|
||||
// NonResourceRules is the list of actions the subject is allowed to perform on non-resources.
|
||||
// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
|
||||
nonResourceRules: [...#NonResourceRule] @go(NonResourceRules,[]NonResourceRule) @protobuf(2,bytes,rep)
|
||||
|
||||
// Incomplete is true when the rules returned by this call are incomplete. This is most commonly
|
||||
// encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation.
|
||||
incomplete: bool @go(Incomplete) @protobuf(3,bytes,rep)
|
||||
|
||||
// EvaluationError can appear in combination with Rules. It indicates an error occurred during
|
||||
// rule evaluation, such as an authorizer that doesn't support rule evaluation, and that
|
||||
// ResourceRules and/or NonResourceRules may be incomplete.
|
||||
// +optional
|
||||
evaluationError?: string @go(EvaluationError) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant,
|
||||
// may contain duplicates, and possibly be incomplete.
|
||||
#ResourceRule: {
|
||||
// Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all.
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
|
||||
// the enumerated resources in any API group will be allowed. "*" means all.
|
||||
// +optional
|
||||
apiGroups?: [...string] @go(APIGroups,[]string) @protobuf(2,bytes,rep)
|
||||
|
||||
// Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups.
|
||||
// "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups.
|
||||
// +optional
|
||||
resources?: [...string] @go(Resources,[]string) @protobuf(3,bytes,rep)
|
||||
|
||||
// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all.
|
||||
// +optional
|
||||
resourceNames?: [...string] @go(ResourceNames,[]string) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// NonResourceRule holds information that describes a rule for the non-resource
|
||||
#NonResourceRule: {
|
||||
// Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all.
|
||||
verbs: [...string] @go(Verbs,[]string) @protobuf(1,bytes,rep)
|
||||
|
||||
// NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full,
|
||||
// final step in the path. "*" means all.
|
||||
// +optional
|
||||
nonResourceURLs?: [...string] @go(NonResourceURLs,[]string) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v1
|
||||
|
||||
package v1
|
||||
|
||||
#GroupName: "autoscaling"
|
||||
@@ -0,0 +1,542 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v1
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// CrossVersionObjectReference contains enough information to let you identify the referred resource.
|
||||
// +structType=atomic
|
||||
#CrossVersionObjectReference: {
|
||||
// kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
kind: string @go(Kind) @protobuf(1,bytes,opt)
|
||||
|
||||
// name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
name: string @go(Name) @protobuf(2,bytes,opt)
|
||||
|
||||
// apiVersion is the API version of the referent
|
||||
// +optional
|
||||
apiVersion?: string @go(APIVersion) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// specification of a horizontal pod autoscaler.
|
||||
#HorizontalPodAutoscalerSpec: {
|
||||
// reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
|
||||
// and will set the desired number of pods by using its Scale subresource.
|
||||
scaleTargetRef: #CrossVersionObjectReference @go(ScaleTargetRef) @protobuf(1,bytes,opt)
|
||||
|
||||
// minReplicas is the lower limit for the number of replicas to which the autoscaler
|
||||
// can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
|
||||
// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
|
||||
// metric is configured. Scaling is active as long as at least one metric value is
|
||||
// available.
|
||||
// +optional
|
||||
minReplicas?: null | int32 @go(MinReplicas,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
|
||||
maxReplicas: int32 @go(MaxReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
|
||||
// if not specified the default autoscaling policy will be used.
|
||||
// +optional
|
||||
targetCPUUtilizationPercentage?: null | int32 @go(TargetCPUUtilizationPercentage,*int32) @protobuf(4,varint,opt)
|
||||
}
|
||||
|
||||
// current status of a horizontal pod autoscaler
|
||||
#HorizontalPodAutoscalerStatus: {
|
||||
// observedGeneration is the most recent generation observed by this autoscaler.
|
||||
// +optional
|
||||
observedGeneration?: null | int64 @go(ObservedGeneration,*int64) @protobuf(1,varint,opt)
|
||||
|
||||
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods;
|
||||
// used by the autoscaler to control how often the number of pods is changed.
|
||||
// +optional
|
||||
lastScaleTime?: null | metav1.#Time @go(LastScaleTime,*metav1.Time) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentReplicas is the current number of replicas of pods managed by this autoscaler.
|
||||
currentReplicas: int32 @go(CurrentReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// desiredReplicas is the desired number of replicas of pods managed by this autoscaler.
|
||||
desiredReplicas: int32 @go(DesiredReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// currentCPUUtilizationPercentage is the current average CPU utilization over all pods, represented as a percentage of requested CPU,
|
||||
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
|
||||
// +optional
|
||||
currentCPUUtilizationPercentage?: null | int32 @go(CurrentCPUUtilizationPercentage,*int32) @protobuf(5,varint,opt)
|
||||
}
|
||||
|
||||
// configuration of a horizontal pod autoscaler.
|
||||
#HorizontalPodAutoscaler: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #HorizontalPodAutoscalerSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// status is the current information about the autoscaler.
|
||||
// +optional
|
||||
status?: #HorizontalPodAutoscalerStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// list of horizontal pod autoscaler objects.
|
||||
#HorizontalPodAutoscalerList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard list metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// items is the list of horizontal pod autoscaler objects.
|
||||
items: [...#HorizontalPodAutoscaler] @go(Items,[]HorizontalPodAutoscaler) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// Scale represents a scaling request for a resource.
|
||||
#Scale: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #ScaleSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// status is the current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
|
||||
// +optional
|
||||
status?: #ScaleStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ScaleSpec describes the attributes of a scale subresource.
|
||||
#ScaleSpec: {
|
||||
// replicas is the desired number of instances for the scaled object.
|
||||
// +optional
|
||||
replicas?: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
}
|
||||
|
||||
// ScaleStatus represents the current status of a scale subresource.
|
||||
#ScaleStatus: {
|
||||
// replicas is the actual number of observed instances of the scaled object.
|
||||
replicas: int32 @go(Replicas) @protobuf(1,varint,opt)
|
||||
|
||||
// selector is the label query over pods that should match the replicas count. This is same
|
||||
// as the label selector but in the string format to avoid introspection
|
||||
// by clients. The string will be in the same format as the query-param syntax.
|
||||
// More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
// +optional
|
||||
selector?: string @go(Selector) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricSourceType indicates the type of metric.
|
||||
// +enum
|
||||
#MetricSourceType: string // #enumMetricSourceType
|
||||
|
||||
#enumMetricSourceType:
|
||||
#ObjectMetricSourceType |
|
||||
#PodsMetricSourceType |
|
||||
#ResourceMetricSourceType |
|
||||
#ContainerResourceMetricSourceType |
|
||||
#ExternalMetricSourceType
|
||||
|
||||
// ObjectMetricSourceType is a metric describing a kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSourceType: #MetricSourceType & "Object"
|
||||
|
||||
// PodsMetricSourceType is a metric describing each pod in the current scale
|
||||
// target (for example, transactions-processed-per-second). The values
|
||||
// will be averaged together before being compared to the target value.
|
||||
#PodsMetricSourceType: #MetricSourceType & "Pods"
|
||||
|
||||
// ResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ResourceMetricSourceType: #MetricSourceType & "Resource"
|
||||
|
||||
// ContainerResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing a single container in each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ContainerResourceMetricSourceType: #MetricSourceType & "ContainerResource"
|
||||
|
||||
// ExternalMetricSourceType is a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
#ExternalMetricSourceType: #MetricSourceType & "External"
|
||||
|
||||
// MetricSpec specifies how to scale based on a single metric
|
||||
// (only `type` and one other matching field should be set at once).
|
||||
#MetricSpec: {
|
||||
// type is the type of metric source. It should be one of "ContainerResource",
|
||||
// "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricSource @go(Object,*ObjectMetricSource) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricSource @go(Pods,*PodsMetricSource) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricSource @go(Resource,*ResourceMetricSource) @protobuf(4,bytes,opt)
|
||||
|
||||
// containerResource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in each pod of the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricSource @go(ContainerResource,*ContainerResourceMetricSource) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricSource @go(External,*ExternalMetricSource) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ObjectMetricSource indicates how to scale on a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSource: {
|
||||
// target is the described Kubernetes object.
|
||||
target: #CrossVersionObjectReference @go(Target) @protobuf(1,bytes)
|
||||
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(2,bytes)
|
||||
|
||||
// targetValue is the target value of the metric (as a quantity).
|
||||
targetValue: resource.#Quantity @go(TargetValue) @protobuf(3,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric.
|
||||
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(4,bytes)
|
||||
|
||||
// averageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(5,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricSource indicates how to scale on a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
// The values will be averaged together before being compared to the target
|
||||
// value.
|
||||
#PodsMetricSource: {
|
||||
// metricName is the name of the metric in question
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
targetAverageValue: resource.#Quantity @go(TargetAverageValue) @protobuf(2,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). The values will be averaged
|
||||
// together before being compared to the target. Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
targetAverageUtilization?: null | int32 @go(TargetAverageUtilization,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in the requests and limits, describing a single container in
|
||||
// each of the pods of the current scale target(e.g. CPU or memory). The values will be
|
||||
// averaged together before being compared to the target. Such metrics are built into
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ContainerResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
targetAverageUtilization?: null | int32 @go(TargetAverageUtilization,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
|
||||
// container is the name of the container in the pods of the scaling target.
|
||||
container: string @go(Container) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricSource indicates how to scale on a metric not associated with
|
||||
// any Kubernetes object (for example length of queue in cloud
|
||||
// messaging service, or QPS from loadbalancer running outside of cluster).
|
||||
#ExternalMetricSource: {
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// metricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
metricSelector?: null | metav1.#LabelSelector @go(MetricSelector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// targetValue is the target value of the metric (as a quantity).
|
||||
// Mutually exclusive with TargetAverageValue.
|
||||
// +optional
|
||||
targetValue?: null | resource.#Quantity @go(TargetValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
|
||||
// targetAverageValue is the target per-pod value of global metric (as a quantity).
|
||||
// Mutually exclusive with TargetValue.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricStatus describes the last-read state of a single metric.
|
||||
#MetricStatus: {
|
||||
// type is the type of metric source. It will be one of "ContainerResource",
|
||||
// "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricStatus @go(Object,*ObjectMetricStatus) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricStatus @go(Pods,*PodsMetricStatus) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricStatus @go(Resource,*ResourceMetricStatus) @protobuf(4,bytes,opt)
|
||||
|
||||
// containerResource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricStatus @go(ContainerResource,*ContainerResourceMetricStatus) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricStatus @go(External,*ExternalMetricStatus) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerConditionType are the valid conditions of
|
||||
// a HorizontalPodAutoscaler.
|
||||
#HorizontalPodAutoscalerConditionType: string // #enumHorizontalPodAutoscalerConditionType
|
||||
|
||||
#enumHorizontalPodAutoscalerConditionType:
|
||||
#ScalingActive |
|
||||
#AbleToScale |
|
||||
#ScalingLimited
|
||||
|
||||
// ScalingActive indicates that the HPA controller is able to scale if necessary:
|
||||
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
|
||||
#ScalingActive: #HorizontalPodAutoscalerConditionType & "ScalingActive"
|
||||
|
||||
// AbleToScale indicates a lack of transient issues which prevent scaling from occurring,
|
||||
// such as being in a backoff window, or being unable to access/update the target scale.
|
||||
#AbleToScale: #HorizontalPodAutoscalerConditionType & "AbleToScale"
|
||||
|
||||
// ScalingLimited indicates that the calculated scale based on metrics would be above or
|
||||
// below the range for the HPA, and has thus been capped.
|
||||
#ScalingLimited: #HorizontalPodAutoscalerConditionType & "ScalingLimited"
|
||||
|
||||
// HorizontalPodAutoscalerCondition describes the state of
|
||||
// a HorizontalPodAutoscaler at a certain point.
|
||||
#HorizontalPodAutoscalerCondition: {
|
||||
// type describes the current condition
|
||||
type: #HorizontalPodAutoscalerConditionType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// status is the status of the condition (True, False, Unknown)
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes)
|
||||
|
||||
// lastTransitionTime is the last time the condition transitioned from
|
||||
// one status to another
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// reason is the reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// message is a human-readable explanation containing details about
|
||||
// the transition
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ObjectMetricStatus indicates the current value of a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricStatus: {
|
||||
// target is the described Kubernetes object.
|
||||
target: #CrossVersionObjectReference @go(Target) @protobuf(1,bytes)
|
||||
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(2,bytes)
|
||||
|
||||
// currentValue is the current value of the metric (as a quantity).
|
||||
currentValue: resource.#Quantity @go(CurrentValue) @protobuf(3,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(4,bytes)
|
||||
|
||||
// averageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(5,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricStatus indicates the current value of a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
#PodsMetricStatus: {
|
||||
// metricName is the name of the metric in question
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(2,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods. It will only be
|
||||
// present if `targetAverageValue` was set in the corresponding metric
|
||||
// specification.
|
||||
// +optional
|
||||
currentAverageUtilization?: null | int32 @go(CurrentAverageUtilization,*int32) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// It will always be set, regardless of the corresponding metric specification.
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ContainerResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods. It will only be
|
||||
// present if `targetAverageValue` was set in the corresponding metric
|
||||
// specification.
|
||||
// +optional
|
||||
currentAverageUtilization?: null | int32 @go(CurrentAverageUtilization,*int32) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// It will always be set, regardless of the corresponding metric specification.
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(3,bytes)
|
||||
|
||||
// container is the name of the container in the pods of the scaling taget
|
||||
container: string @go(Container) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricStatus indicates the current value of a global metric
|
||||
// not associated with any Kubernetes object.
|
||||
#ExternalMetricStatus: {
|
||||
// metricName is the name of a metric used for autoscaling in
|
||||
// metric system.
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// metricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
metricSelector?: null | metav1.#LabelSelector @go(MetricSelector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentValue is the current value of the metric (as a quantity)
|
||||
currentValue: resource.#Quantity @go(CurrentValue) @protobuf(3,bytes)
|
||||
|
||||
// currentAverageValue is the current value of metric averaged over autoscaled pods.
|
||||
// +optional
|
||||
currentAverageValue?: null | resource.#Quantity @go(CurrentAverageValue,*resource.Quantity) @protobuf(4,bytes,opt)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v2
|
||||
|
||||
package v2
|
||||
|
||||
#GroupName: "autoscaling"
|
||||
@@ -0,0 +1,597 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v2
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// HorizontalPodAutoscaler is the configuration for a horizontal pod
|
||||
// autoscaler, which automatically manages the replica count of any resource
|
||||
// implementing the scale subresource based on the metrics specified.
|
||||
#HorizontalPodAutoscaler: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// metadata is the standard object metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// spec is the specification for the behaviour of the autoscaler.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #HorizontalPodAutoscalerSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// status is the current information about the autoscaler.
|
||||
// +optional
|
||||
status?: #HorizontalPodAutoscalerStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
|
||||
#HorizontalPodAutoscalerSpec: {
|
||||
// scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
|
||||
// should be collected, as well as to actually change the replica count.
|
||||
scaleTargetRef: #CrossVersionObjectReference @go(ScaleTargetRef) @protobuf(1,bytes,opt)
|
||||
|
||||
// minReplicas is the lower limit for the number of replicas to which the autoscaler
|
||||
// can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
|
||||
// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
|
||||
// metric is configured. Scaling is active as long as at least one metric value is
|
||||
// available.
|
||||
// +optional
|
||||
minReplicas?: null | int32 @go(MinReplicas,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
|
||||
// It cannot be less that minReplicas.
|
||||
maxReplicas: int32 @go(MaxReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// metrics contains the specifications for which to use to calculate the
|
||||
// desired replica count (the maximum replica count across all metrics will
|
||||
// be used). The desired replica count is calculated multiplying the
|
||||
// ratio between the target value and the current value by the current
|
||||
// number of pods. Ergo, metrics used must decrease as the pod count is
|
||||
// increased, and vice-versa. See the individual metric source types for
|
||||
// more information about how each type of metric must respond.
|
||||
// If not set, the default metric will be set to 80% average CPU utilization.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
metrics?: [...#MetricSpec] @go(Metrics,[]MetricSpec) @protobuf(4,bytes,rep)
|
||||
|
||||
// behavior configures the scaling behavior of the target
|
||||
// in both Up and Down directions (scaleUp and scaleDown fields respectively).
|
||||
// If not set, the default HPAScalingRules for scale up and scale down are used.
|
||||
// +optional
|
||||
behavior?: null | #HorizontalPodAutoscalerBehavior @go(Behavior,*HorizontalPodAutoscalerBehavior) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// CrossVersionObjectReference contains enough information to let you identify the referred resource.
|
||||
#CrossVersionObjectReference: {
|
||||
// kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
kind: string @go(Kind) @protobuf(1,bytes,opt)
|
||||
|
||||
// name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
name: string @go(Name) @protobuf(2,bytes,opt)
|
||||
|
||||
// apiVersion is the API version of the referent
|
||||
// +optional
|
||||
apiVersion?: string @go(APIVersion) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricSpec specifies how to scale based on a single metric
|
||||
// (only `type` and one other matching field should be set at once).
|
||||
#MetricSpec: {
|
||||
// type is the type of metric source. It should be one of "ContainerResource", "External",
|
||||
// "Object", "Pods" or "Resource", each mapping to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricSource @go(Object,*ObjectMetricSource) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricSource @go(Pods,*PodsMetricSource) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricSource @go(Resource,*ResourceMetricSource) @protobuf(4,bytes,opt)
|
||||
|
||||
// containerResource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in
|
||||
// each pod of the current scale target (e.g. CPU or memory). Such metrics are
|
||||
// built in to Kubernetes, and have special scaling options on top of those
|
||||
// available to normal per-pod metrics using the "pods" source.
|
||||
// This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricSource @go(ContainerResource,*ContainerResourceMetricSource) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricSource @go(External,*ExternalMetricSource) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerBehavior configures the scaling behavior of the target
|
||||
// in both Up and Down directions (scaleUp and scaleDown fields respectively).
|
||||
#HorizontalPodAutoscalerBehavior: {
|
||||
// scaleUp is scaling policy for scaling Up.
|
||||
// If not set, the default value is the higher of:
|
||||
// * increase no more than 4 pods per 60 seconds
|
||||
// * double the number of pods per 60 seconds
|
||||
// No stabilization is used.
|
||||
// +optional
|
||||
scaleUp?: null | #HPAScalingRules @go(ScaleUp,*HPAScalingRules) @protobuf(1,bytes,opt)
|
||||
|
||||
// scaleDown is scaling policy for scaling Down.
|
||||
// If not set, the default value is to allow to scale down to minReplicas pods, with a
|
||||
// 300 second stabilization window (i.e., the highest recommendation for
|
||||
// the last 300sec is used).
|
||||
// +optional
|
||||
scaleDown?: null | #HPAScalingRules @go(ScaleDown,*HPAScalingRules) @protobuf(2,bytes,opt)
|
||||
}
|
||||
|
||||
// ScalingPolicySelect is used to specify which policy should be used while scaling in a certain direction
|
||||
#ScalingPolicySelect: string // #enumScalingPolicySelect
|
||||
|
||||
#enumScalingPolicySelect:
|
||||
#MaxChangePolicySelect |
|
||||
#MinChangePolicySelect |
|
||||
#DisabledPolicySelect
|
||||
|
||||
// MaxChangePolicySelect selects the policy with the highest possible change.
|
||||
#MaxChangePolicySelect: #ScalingPolicySelect & "Max"
|
||||
|
||||
// MinChangePolicySelect selects the policy with the lowest possible change.
|
||||
#MinChangePolicySelect: #ScalingPolicySelect & "Min"
|
||||
|
||||
// DisabledPolicySelect disables the scaling in this direction.
|
||||
#DisabledPolicySelect: #ScalingPolicySelect & "Disabled"
|
||||
|
||||
// HPAScalingRules configures the scaling behavior for one direction.
|
||||
// These Rules are applied after calculating DesiredReplicas from metrics for the HPA.
|
||||
// They can limit the scaling velocity by specifying scaling policies.
|
||||
// They can prevent flapping by specifying the stabilization window, so that the
|
||||
// number of replicas is not set instantly, instead, the safest value from the stabilization
|
||||
// window is chosen.
|
||||
#HPAScalingRules: {
|
||||
// stabilizationWindowSeconds is the number of seconds for which past recommendations should be
|
||||
// considered while scaling up or scaling down.
|
||||
// StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
|
||||
// If not set, use the default values:
|
||||
// - For scale up: 0 (i.e. no stabilization is done).
|
||||
// - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
|
||||
// +optional
|
||||
stabilizationWindowSeconds?: null | int32 @go(StabilizationWindowSeconds,*int32) @protobuf(3,varint,opt)
|
||||
|
||||
// selectPolicy is used to specify which policy should be used.
|
||||
// If not set, the default value Max is used.
|
||||
// +optional
|
||||
selectPolicy?: null | #ScalingPolicySelect @go(SelectPolicy,*ScalingPolicySelect) @protobuf(1,bytes,opt)
|
||||
|
||||
// policies is a list of potential scaling polices which can be used during scaling.
|
||||
// At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
policies?: [...#HPAScalingPolicy] @go(Policies,[]HPAScalingPolicy) @protobuf(2,bytes,rep)
|
||||
}
|
||||
|
||||
// HPAScalingPolicyType is the type of the policy which could be used while making scaling decisions.
|
||||
#HPAScalingPolicyType: string // #enumHPAScalingPolicyType
|
||||
|
||||
#enumHPAScalingPolicyType:
|
||||
#PodsScalingPolicy |
|
||||
#PercentScalingPolicy
|
||||
|
||||
// PodsScalingPolicy is a policy used to specify a change in absolute number of pods.
|
||||
#PodsScalingPolicy: #HPAScalingPolicyType & "Pods"
|
||||
|
||||
// PercentScalingPolicy is a policy used to specify a relative amount of change with respect to
|
||||
// the current number of pods.
|
||||
#PercentScalingPolicy: #HPAScalingPolicyType & "Percent"
|
||||
|
||||
// HPAScalingPolicy is a single policy which must hold true for a specified past interval.
|
||||
#HPAScalingPolicy: {
|
||||
// type is used to specify the scaling policy.
|
||||
type: #HPAScalingPolicyType @go(Type) @protobuf(1,bytes,opt,casttype=HPAScalingPolicyType)
|
||||
|
||||
// value contains the amount of change which is permitted by the policy.
|
||||
// It must be greater than zero
|
||||
value: int32 @go(Value) @protobuf(2,varint,opt)
|
||||
|
||||
// periodSeconds specifies the window of time for which the policy should hold true.
|
||||
// PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
|
||||
periodSeconds: int32 @go(PeriodSeconds) @protobuf(3,varint,opt)
|
||||
}
|
||||
|
||||
// MetricSourceType indicates the type of metric.
|
||||
#MetricSourceType: string // #enumMetricSourceType
|
||||
|
||||
#enumMetricSourceType:
|
||||
#ObjectMetricSourceType |
|
||||
#PodsMetricSourceType |
|
||||
#ResourceMetricSourceType |
|
||||
#ContainerResourceMetricSourceType |
|
||||
#ExternalMetricSourceType
|
||||
|
||||
// ObjectMetricSourceType is a metric describing a kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSourceType: #MetricSourceType & "Object"
|
||||
|
||||
// PodsMetricSourceType is a metric describing each pod in the current scale
|
||||
// target (for example, transactions-processed-per-second). The values
|
||||
// will be averaged together before being compared to the target value.
|
||||
#PodsMetricSourceType: #MetricSourceType & "Pods"
|
||||
|
||||
// ResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ResourceMetricSourceType: #MetricSourceType & "Resource"
|
||||
|
||||
// ContainerResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing a single container in each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ContainerResourceMetricSourceType: #MetricSourceType & "ContainerResource"
|
||||
|
||||
// ExternalMetricSourceType is a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
#ExternalMetricSourceType: #MetricSourceType & "External"
|
||||
|
||||
// ObjectMetricSource indicates how to scale on a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSource: {
|
||||
// describedObject specifies the descriptions of a object,such as kind,name apiVersion
|
||||
describedObject: #CrossVersionObjectReference @go(DescribedObject) @protobuf(1,bytes)
|
||||
|
||||
// target specifies the target value for the given metric
|
||||
target: #MetricTarget @go(Target) @protobuf(2,bytes)
|
||||
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricSource indicates how to scale on a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
// The values will be averaged together before being compared to the target
|
||||
// value.
|
||||
#PodsMetricSource: {
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(1,bytes)
|
||||
|
||||
// target specifies the target value for the given metric
|
||||
target: #MetricTarget @go(Target) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). The values will be averaged
|
||||
// together before being compared to the target. Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// target specifies the target value for the given metric
|
||||
target: #MetricTarget @go(Target) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). The values will be averaged
|
||||
// together before being compared to the target. Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ContainerResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// target specifies the target value for the given metric
|
||||
target: #MetricTarget @go(Target) @protobuf(2,bytes)
|
||||
|
||||
// container is the name of the container in the pods of the scaling target
|
||||
container: string @go(Container) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricSource indicates how to scale on a metric not associated with
|
||||
// any Kubernetes object (for example length of queue in cloud
|
||||
// messaging service, or QPS from loadbalancer running outside of cluster).
|
||||
#ExternalMetricSource: {
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(1,bytes)
|
||||
|
||||
// target specifies the target value for the given metric
|
||||
target: #MetricTarget @go(Target) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// MetricIdentifier defines the name and optionally selector for a metric
|
||||
#MetricIdentifier: {
|
||||
// name is the name of the given metric
|
||||
name: string @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// MetricTarget defines the target value, average value, or average utilization of a specific metric
|
||||
#MetricTarget: {
|
||||
// type represents whether the metric type is Utilization, Value, or AverageValue
|
||||
type: #MetricTargetType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// value is the target value of the metric (as a quantity).
|
||||
// +optional
|
||||
value?: null | resource.#Quantity @go(Value,*resource.Quantity) @protobuf(2,bytes,opt)
|
||||
|
||||
// averageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
|
||||
// averageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// Currently only valid for Resource metric source type
|
||||
// +optional
|
||||
averageUtilization?: null | int32 @go(AverageUtilization,*int32) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricTargetType specifies the type of metric being targeted, and should be either
|
||||
// "Value", "AverageValue", or "Utilization"
|
||||
#MetricTargetType: string // #enumMetricTargetType
|
||||
|
||||
#enumMetricTargetType:
|
||||
#UtilizationMetricType |
|
||||
#ValueMetricType |
|
||||
#AverageValueMetricType
|
||||
|
||||
// UtilizationMetricType declares a MetricTarget is an AverageUtilization value
|
||||
#UtilizationMetricType: #MetricTargetType & "Utilization"
|
||||
|
||||
// ValueMetricType declares a MetricTarget is a raw value
|
||||
#ValueMetricType: #MetricTargetType & "Value"
|
||||
|
||||
// AverageValueMetricType declares a MetricTarget is an
|
||||
#AverageValueMetricType: #MetricTargetType & "AverageValue"
|
||||
|
||||
// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
|
||||
#HorizontalPodAutoscalerStatus: {
|
||||
// observedGeneration is the most recent generation observed by this autoscaler.
|
||||
// +optional
|
||||
observedGeneration?: null | int64 @go(ObservedGeneration,*int64) @protobuf(1,varint,opt)
|
||||
|
||||
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
|
||||
// used by the autoscaler to control how often the number of pods is changed.
|
||||
// +optional
|
||||
lastScaleTime?: null | metav1.#Time @go(LastScaleTime,*metav1.Time) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentReplicas is current number of replicas of pods managed by this autoscaler,
|
||||
// as last seen by the autoscaler.
|
||||
// +optional
|
||||
currentReplicas?: int32 @go(CurrentReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
|
||||
// as last calculated by the autoscaler.
|
||||
desiredReplicas: int32 @go(DesiredReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// currentMetrics is the last read state of the metrics used by this autoscaler.
|
||||
// +listType=atomic
|
||||
// +optional
|
||||
currentMetrics?: [...#MetricStatus] @go(CurrentMetrics,[]MetricStatus) @protobuf(5,bytes,rep)
|
||||
|
||||
// conditions is the set of conditions required for this autoscaler to scale its target,
|
||||
// and indicates whether or not those conditions are met.
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
conditions?: [...#HorizontalPodAutoscalerCondition] @go(Conditions,[]HorizontalPodAutoscalerCondition) @protobuf(6,bytes,rep)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerConditionType are the valid conditions of
|
||||
// a HorizontalPodAutoscaler.
|
||||
#HorizontalPodAutoscalerConditionType: string // #enumHorizontalPodAutoscalerConditionType
|
||||
|
||||
#enumHorizontalPodAutoscalerConditionType:
|
||||
#ScalingActive |
|
||||
#AbleToScale |
|
||||
#ScalingLimited
|
||||
|
||||
// ScalingActive indicates that the HPA controller is able to scale if necessary:
|
||||
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
|
||||
#ScalingActive: #HorizontalPodAutoscalerConditionType & "ScalingActive"
|
||||
|
||||
// AbleToScale indicates a lack of transient issues which prevent scaling from occurring,
|
||||
// such as being in a backoff window, or being unable to access/update the target scale.
|
||||
#AbleToScale: #HorizontalPodAutoscalerConditionType & "AbleToScale"
|
||||
|
||||
// ScalingLimited indicates that the calculated scale based on metrics would be above or
|
||||
// below the range for the HPA, and has thus been capped.
|
||||
#ScalingLimited: #HorizontalPodAutoscalerConditionType & "ScalingLimited"
|
||||
|
||||
// HorizontalPodAutoscalerCondition describes the state of
|
||||
// a HorizontalPodAutoscaler at a certain point.
|
||||
#HorizontalPodAutoscalerCondition: {
|
||||
// type describes the current condition
|
||||
type: #HorizontalPodAutoscalerConditionType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// status is the status of the condition (True, False, Unknown)
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes)
|
||||
|
||||
// lastTransitionTime is the last time the condition transitioned from
|
||||
// one status to another
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// reason is the reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// message is a human-readable explanation containing details about
|
||||
// the transition
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricStatus describes the last-read state of a single metric.
|
||||
#MetricStatus: {
|
||||
// type is the type of metric source. It will be one of "ContainerResource", "External",
|
||||
// "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricStatus @go(Object,*ObjectMetricStatus) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricStatus @go(Pods,*PodsMetricStatus) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricStatus @go(Resource,*ResourceMetricStatus) @protobuf(4,bytes,opt)
|
||||
|
||||
// container resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricStatus @go(ContainerResource,*ContainerResourceMetricStatus) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricStatus @go(External,*ExternalMetricStatus) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ObjectMetricStatus indicates the current value of a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricStatus: {
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(1,bytes)
|
||||
|
||||
// current contains the current value for the given metric
|
||||
current: #MetricValueStatus @go(Current) @protobuf(2,bytes)
|
||||
|
||||
// DescribedObject specifies the descriptions of a object,such as kind,name apiVersion
|
||||
describedObject: #CrossVersionObjectReference @go(DescribedObject) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricStatus indicates the current value of a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
#PodsMetricStatus: {
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(1,bytes)
|
||||
|
||||
// current contains the current value for the given metric
|
||||
current: #MetricValueStatus @go(Current) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// current contains the current value for the given metric
|
||||
current: #MetricValueStatus @go(Current) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ContainerResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// current contains the current value for the given metric
|
||||
current: #MetricValueStatus @go(Current) @protobuf(2,bytes)
|
||||
|
||||
// container is the name of the container in the pods of the scaling target
|
||||
container: string @go(Container) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricStatus indicates the current value of a global metric
|
||||
// not associated with any Kubernetes object.
|
||||
#ExternalMetricStatus: {
|
||||
// metric identifies the target metric by name and selector
|
||||
metric: #MetricIdentifier @go(Metric) @protobuf(1,bytes)
|
||||
|
||||
// current contains the current value for the given metric
|
||||
current: #MetricValueStatus @go(Current) @protobuf(2,bytes)
|
||||
}
|
||||
|
||||
// MetricValueStatus holds the current value for a metric
|
||||
#MetricValueStatus: {
|
||||
// value is the current value of the metric (as a quantity).
|
||||
// +optional
|
||||
value?: null | resource.#Quantity @go(Value,*resource.Quantity) @protobuf(1,bytes,opt)
|
||||
|
||||
// averageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
averageUtilization?: null | int32 @go(AverageUtilization,*int32) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
|
||||
#HorizontalPodAutoscalerList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// metadata is the standard list metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// items is the list of horizontal pod autoscaler objects.
|
||||
items: [...#HorizontalPodAutoscaler] @go(Items,[]HorizontalPodAutoscaler) @protobuf(2,bytes,rep)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v2beta1
|
||||
|
||||
package v2beta1
|
||||
|
||||
#GroupName: "autoscaling"
|
||||
@@ -0,0 +1,520 @@
|
||||
// Code generated by cue get go. DO NOT EDIT.
|
||||
|
||||
//cue:generate cue get go k8s.io/api/autoscaling/v2beta1
|
||||
|
||||
package v2beta1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// CrossVersionObjectReference contains enough information to let you identify the referred resource.
|
||||
#CrossVersionObjectReference: {
|
||||
// Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
kind: string @go(Kind) @protobuf(1,bytes,opt)
|
||||
|
||||
// Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
name: string @go(Name) @protobuf(2,bytes,opt)
|
||||
|
||||
// API version of the referent
|
||||
// +optional
|
||||
apiVersion?: string @go(APIVersion) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
|
||||
#HorizontalPodAutoscalerSpec: {
|
||||
// scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
|
||||
// should be collected, as well as to actually change the replica count.
|
||||
scaleTargetRef: #CrossVersionObjectReference @go(ScaleTargetRef) @protobuf(1,bytes,opt)
|
||||
|
||||
// minReplicas is the lower limit for the number of replicas to which the autoscaler
|
||||
// can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
|
||||
// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
|
||||
// metric is configured. Scaling is active as long as at least one metric value is
|
||||
// available.
|
||||
// +optional
|
||||
minReplicas?: null | int32 @go(MinReplicas,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
|
||||
// It cannot be less that minReplicas.
|
||||
maxReplicas: int32 @go(MaxReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// metrics contains the specifications for which to use to calculate the
|
||||
// desired replica count (the maximum replica count across all metrics will
|
||||
// be used). The desired replica count is calculated multiplying the
|
||||
// ratio between the target value and the current value by the current
|
||||
// number of pods. Ergo, metrics used must decrease as the pod count is
|
||||
// increased, and vice-versa. See the individual metric source types for
|
||||
// more information about how each type of metric must respond.
|
||||
// +optional
|
||||
metrics?: [...#MetricSpec] @go(Metrics,[]MetricSpec) @protobuf(4,bytes,rep)
|
||||
}
|
||||
|
||||
// MetricSourceType indicates the type of metric.
|
||||
#MetricSourceType: string // #enumMetricSourceType
|
||||
|
||||
#enumMetricSourceType:
|
||||
#ObjectMetricSourceType |
|
||||
#PodsMetricSourceType |
|
||||
#ResourceMetricSourceType |
|
||||
#ContainerResourceMetricSourceType |
|
||||
#ExternalMetricSourceType
|
||||
|
||||
// ObjectMetricSourceType is a metric describing a kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSourceType: #MetricSourceType & "Object"
|
||||
|
||||
// PodsMetricSourceType is a metric describing each pod in the current scale
|
||||
// target (for example, transactions-processed-per-second). The values
|
||||
// will be averaged together before being compared to the target value.
|
||||
#PodsMetricSourceType: #MetricSourceType & "Pods"
|
||||
|
||||
// ResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ResourceMetricSourceType: #MetricSourceType & "Resource"
|
||||
|
||||
// ContainerResourceMetricSourceType is a resource metric known to Kubernetes, as
|
||||
// specified in requests and limits, describing a single container in each pod in the current
|
||||
// scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics (the "pods" source).
|
||||
#ContainerResourceMetricSourceType: #MetricSourceType & "ContainerResource"
|
||||
|
||||
// ExternalMetricSourceType is a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
#ExternalMetricSourceType: #MetricSourceType & "External"
|
||||
|
||||
// MetricSpec specifies how to scale based on a single metric
|
||||
// (only `type` and one other matching field should be set at once).
|
||||
#MetricSpec: {
|
||||
// type is the type of metric source. It should be one of "ContainerResource",
|
||||
// "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricSource @go(Object,*ObjectMetricSource) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricSource @go(Pods,*PodsMetricSource) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricSource @go(Resource,*ResourceMetricSource) @protobuf(4,bytes,opt)
|
||||
|
||||
// container resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in
|
||||
// each pod of the current scale target (e.g. CPU or memory). Such metrics are
|
||||
// built in to Kubernetes, and have special scaling options on top of those
|
||||
// available to normal per-pod metrics using the "pods" source.
|
||||
// This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricSource @go(ContainerResource,*ContainerResourceMetricSource) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricSource @go(External,*ExternalMetricSource) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ObjectMetricSource indicates how to scale on a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricSource: {
|
||||
// target is the described Kubernetes object.
|
||||
target: #CrossVersionObjectReference @go(Target) @protobuf(1,bytes)
|
||||
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(2,bytes)
|
||||
|
||||
// targetValue is the target value of the metric (as a quantity).
|
||||
targetValue: resource.#Quantity @go(TargetValue) @protobuf(3,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(4,bytes)
|
||||
|
||||
// averageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(5,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricSource indicates how to scale on a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
// The values will be averaged together before being compared to the target
|
||||
// value.
|
||||
#PodsMetricSource: {
|
||||
// metricName is the name of the metric in question
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
targetAverageValue: resource.#Quantity @go(TargetAverageValue) @protobuf(2,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). The values will be averaged
|
||||
// together before being compared to the target. Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
targetAverageUtilization?: null | int32 @go(TargetAverageUtilization,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricSource indicates how to scale on a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). The values will be averaged
|
||||
// together before being compared to the target. Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source. Only one "target" type
|
||||
// should be set.
|
||||
#ContainerResourceMetricSource: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// targetAverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
targetAverageUtilization?: null | int32 @go(TargetAverageUtilization,*int32) @protobuf(2,varint,opt)
|
||||
|
||||
// targetAverageValue is the target value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
|
||||
// container is the name of the container in the pods of the scaling target
|
||||
container: string @go(Container) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricSource indicates how to scale on a metric not associated with
|
||||
// any Kubernetes object (for example length of queue in cloud
|
||||
// messaging service, or QPS from loadbalancer running outside of cluster).
|
||||
// Exactly one "target" type should be set.
|
||||
#ExternalMetricSource: {
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// metricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
metricSelector?: null | metav1.#LabelSelector @go(MetricSelector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// targetValue is the target value of the metric (as a quantity).
|
||||
// Mutually exclusive with TargetAverageValue.
|
||||
// +optional
|
||||
targetValue?: null | resource.#Quantity @go(TargetValue,*resource.Quantity) @protobuf(3,bytes,opt)
|
||||
|
||||
// targetAverageValue is the target per-pod value of global metric (as a quantity).
|
||||
// Mutually exclusive with TargetValue.
|
||||
// +optional
|
||||
targetAverageValue?: null | resource.#Quantity @go(TargetAverageValue,*resource.Quantity) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
|
||||
#HorizontalPodAutoscalerStatus: {
|
||||
// observedGeneration is the most recent generation observed by this autoscaler.
|
||||
// +optional
|
||||
observedGeneration?: null | int64 @go(ObservedGeneration,*int64) @protobuf(1,varint,opt)
|
||||
|
||||
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
|
||||
// used by the autoscaler to control how often the number of pods is changed.
|
||||
// +optional
|
||||
lastScaleTime?: null | metav1.#Time @go(LastScaleTime,*metav1.Time) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentReplicas is current number of replicas of pods managed by this autoscaler,
|
||||
// as last seen by the autoscaler.
|
||||
currentReplicas: int32 @go(CurrentReplicas) @protobuf(3,varint,opt)
|
||||
|
||||
// desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
|
||||
// as last calculated by the autoscaler.
|
||||
desiredReplicas: int32 @go(DesiredReplicas) @protobuf(4,varint,opt)
|
||||
|
||||
// currentMetrics is the last read state of the metrics used by this autoscaler.
|
||||
// +optional
|
||||
currentMetrics?: [...#MetricStatus] @go(CurrentMetrics,[]MetricStatus) @protobuf(5,bytes,rep)
|
||||
|
||||
// conditions is the set of conditions required for this autoscaler to scale its target,
|
||||
// and indicates whether or not those conditions are met.
|
||||
// +optional
|
||||
conditions?: [...#HorizontalPodAutoscalerCondition] @go(Conditions,[]HorizontalPodAutoscalerCondition) @protobuf(6,bytes,rep)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerConditionType are the valid conditions of
|
||||
// a HorizontalPodAutoscaler.
|
||||
#HorizontalPodAutoscalerConditionType: string // #enumHorizontalPodAutoscalerConditionType
|
||||
|
||||
#enumHorizontalPodAutoscalerConditionType:
|
||||
#ScalingActive |
|
||||
#AbleToScale |
|
||||
#ScalingLimited
|
||||
|
||||
// ScalingActive indicates that the HPA controller is able to scale if necessary:
|
||||
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
|
||||
#ScalingActive: #HorizontalPodAutoscalerConditionType & "ScalingActive"
|
||||
|
||||
// AbleToScale indicates a lack of transient issues which prevent scaling from occurring,
|
||||
// such as being in a backoff window, or being unable to access/update the target scale.
|
||||
#AbleToScale: #HorizontalPodAutoscalerConditionType & "AbleToScale"
|
||||
|
||||
// ScalingLimited indicates that the calculated scale based on metrics would be above or
|
||||
// below the range for the HPA, and has thus been capped.
|
||||
#ScalingLimited: #HorizontalPodAutoscalerConditionType & "ScalingLimited"
|
||||
|
||||
// HorizontalPodAutoscalerCondition describes the state of
|
||||
// a HorizontalPodAutoscaler at a certain point.
|
||||
#HorizontalPodAutoscalerCondition: {
|
||||
// type describes the current condition
|
||||
type: #HorizontalPodAutoscalerConditionType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// status is the status of the condition (True, False, Unknown)
|
||||
status: v1.#ConditionStatus @go(Status) @protobuf(2,bytes)
|
||||
|
||||
// lastTransitionTime is the last time the condition transitioned from
|
||||
// one status to another
|
||||
// +optional
|
||||
lastTransitionTime?: metav1.#Time @go(LastTransitionTime) @protobuf(3,bytes,opt)
|
||||
|
||||
// reason is the reason for the condition's last transition.
|
||||
// +optional
|
||||
reason?: string @go(Reason) @protobuf(4,bytes,opt)
|
||||
|
||||
// message is a human-readable explanation containing details about
|
||||
// the transition
|
||||
// +optional
|
||||
message?: string @go(Message) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// MetricStatus describes the last-read state of a single metric.
|
||||
#MetricStatus: {
|
||||
// type is the type of metric source. It will be one of "ContainerResource",
|
||||
// "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
|
||||
// Note: "ContainerResource" type is available on when the feature-gate
|
||||
// HPAContainerMetrics is enabled
|
||||
type: #MetricSourceType @go(Type) @protobuf(1,bytes)
|
||||
|
||||
// object refers to a metric describing a single kubernetes object
|
||||
// (for example, hits-per-second on an Ingress object).
|
||||
// +optional
|
||||
object?: null | #ObjectMetricStatus @go(Object,*ObjectMetricStatus) @protobuf(2,bytes,opt)
|
||||
|
||||
// pods refers to a metric describing each pod in the current scale target
|
||||
// (for example, transactions-processed-per-second). The values will be
|
||||
// averaged together before being compared to the target value.
|
||||
// +optional
|
||||
pods?: null | #PodsMetricStatus @go(Pods,*PodsMetricStatus) @protobuf(3,bytes,opt)
|
||||
|
||||
// resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
resource?: null | #ResourceMetricStatus @go(Resource,*ResourceMetricStatus) @protobuf(4,bytes,opt)
|
||||
|
||||
// container resource refers to a resource metric (such as those specified in
|
||||
// requests and limits) known to Kubernetes describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available
|
||||
// to normal per-pod metrics using the "pods" source.
|
||||
// +optional
|
||||
containerResource?: null | #ContainerResourceMetricStatus @go(ContainerResource,*ContainerResourceMetricStatus) @protobuf(7,bytes,opt)
|
||||
|
||||
// external refers to a global metric that is not associated
|
||||
// with any Kubernetes object. It allows autoscaling based on information
|
||||
// coming from components running outside of cluster
|
||||
// (for example length of queue in cloud messaging service, or
|
||||
// QPS from loadbalancer running outside of cluster).
|
||||
// +optional
|
||||
external?: null | #ExternalMetricStatus @go(External,*ExternalMetricStatus) @protobuf(5,bytes,opt)
|
||||
}
|
||||
|
||||
// ObjectMetricStatus indicates the current value of a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
#ObjectMetricStatus: {
|
||||
// target is the described Kubernetes object.
|
||||
target: #CrossVersionObjectReference @go(Target) @protobuf(1,bytes)
|
||||
|
||||
// metricName is the name of the metric in question.
|
||||
metricName: string @go(MetricName) @protobuf(2,bytes)
|
||||
|
||||
// currentValue is the current value of the metric (as a quantity).
|
||||
currentValue: resource.#Quantity @go(CurrentValue) @protobuf(3,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(4,bytes)
|
||||
|
||||
// averageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
// +optional
|
||||
averageValue?: null | resource.#Quantity @go(AverageValue,*resource.Quantity) @protobuf(5,bytes)
|
||||
}
|
||||
|
||||
// PodsMetricStatus indicates the current value of a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
#PodsMetricStatus: {
|
||||
// metricName is the name of the metric in question
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(2,bytes)
|
||||
|
||||
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
|
||||
// When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
|
||||
// When unset, just the metricName will be used to gather metrics.
|
||||
// +optional
|
||||
selector?: null | metav1.#LabelSelector @go(Selector,*metav1.LabelSelector) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods. It will only be
|
||||
// present if `targetAverageValue` was set in the corresponding metric
|
||||
// specification.
|
||||
// +optional
|
||||
currentAverageUtilization?: null | int32 @go(CurrentAverageUtilization,*int32) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// It will always be set, regardless of the corresponding metric specification.
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(3,bytes)
|
||||
}
|
||||
|
||||
// ContainerResourceMetricStatus indicates the current value of a resource metric known to
|
||||
// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
|
||||
// current scale target (e.g. CPU or memory). Such metrics are built in to
|
||||
// Kubernetes, and have special scaling options on top of those available to
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
#ContainerResourceMetricStatus: {
|
||||
// name is the name of the resource in question.
|
||||
name: v1.#ResourceName @go(Name) @protobuf(1,bytes)
|
||||
|
||||
// currentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods. It will only be
|
||||
// present if `targetAverageValue` was set in the corresponding metric
|
||||
// specification.
|
||||
// +optional
|
||||
currentAverageUtilization?: null | int32 @go(CurrentAverageUtilization,*int32) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentAverageValue is the current value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// It will always be set, regardless of the corresponding metric specification.
|
||||
currentAverageValue: resource.#Quantity @go(CurrentAverageValue) @protobuf(3,bytes)
|
||||
|
||||
// container is the name of the container in the pods of the scaling target
|
||||
container: string @go(Container) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// ExternalMetricStatus indicates the current value of a global metric
|
||||
// not associated with any Kubernetes object.
|
||||
#ExternalMetricStatus: {
|
||||
// metricName is the name of a metric used for autoscaling in
|
||||
// metric system.
|
||||
metricName: string @go(MetricName) @protobuf(1,bytes)
|
||||
|
||||
// metricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
metricSelector?: null | metav1.#LabelSelector @go(MetricSelector,*metav1.LabelSelector) @protobuf(2,bytes,opt)
|
||||
|
||||
// currentValue is the current value of the metric (as a quantity)
|
||||
currentValue: resource.#Quantity @go(CurrentValue) @protobuf(3,bytes)
|
||||
|
||||
// currentAverageValue is the current value of metric averaged over autoscaled pods.
|
||||
// +optional
|
||||
currentAverageValue?: null | resource.#Quantity @go(CurrentAverageValue,*resource.Quantity) @protobuf(4,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscaler is the configuration for a horizontal pod
|
||||
// autoscaler, which automatically manages the replica count of any resource
|
||||
// implementing the scale subresource based on the metrics specified.
|
||||
#HorizontalPodAutoscaler: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// metadata is the standard object metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metadata?: metav1.#ObjectMeta @go(ObjectMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// spec is the specification for the behaviour of the autoscaler.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
|
||||
// +optional
|
||||
spec?: #HorizontalPodAutoscalerSpec @go(Spec) @protobuf(2,bytes,opt)
|
||||
|
||||
// status is the current information about the autoscaler.
|
||||
// +optional
|
||||
status?: #HorizontalPodAutoscalerStatus @go(Status) @protobuf(3,bytes,opt)
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
|
||||
#HorizontalPodAutoscalerList: {
|
||||
metav1.#TypeMeta
|
||||
|
||||
// metadata is the standard list metadata.
|
||||
// +optional
|
||||
metadata?: metav1.#ListMeta @go(ListMeta) @protobuf(1,bytes,opt)
|
||||
|
||||
// items is the list of horizontal pod autoscaler objects.
|
||||
items: [...#HorizontalPodAutoscaler] @go(Items,[]HorizontalPodAutoscaler) @protobuf(2,bytes,rep)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user