├── .github ├── FUNDING.yml ├── dependabot.yml ├── release.yml └── workflows │ ├── automerge.yml │ └── ci.yml ├── .gitignore ├── Cargo.toml ├── LICENSE ├── README.md ├── justfile ├── k8s-pb-codegen ├── .gitignore ├── Cargo.toml ├── openapi │ ├── patches │ │ └── patch-nonexistent-gvk.jq │ ├── swagger.json │ ├── transform.jq │ └── transformed.json ├── protos.list ├── protos │ ├── api │ │ ├── admission │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── admissionregistration │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── apidiscovery │ │ │ ├── v2 │ │ │ │ └── generated.proto │ │ │ └── v2beta1 │ │ │ │ └── generated.proto │ │ ├── apiserverinternal │ │ │ └── v1alpha1 │ │ │ │ └── generated.proto │ │ ├── apps │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1beta1 │ │ │ │ └── generated.proto │ │ │ └── v1beta2 │ │ │ │ └── generated.proto │ │ ├── authentication │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── authorization │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── autoscaling │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v2 │ │ │ │ └── generated.proto │ │ │ ├── v2beta1 │ │ │ │ └── generated.proto │ │ │ └── v2beta2 │ │ │ │ └── generated.proto │ │ ├── batch │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── certificates │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── coordination │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha2 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── core │ │ │ └── v1 │ │ │ │ └── generated.proto │ │ ├── discovery │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── events │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── extensions │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── flowcontrol │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1beta1 │ │ │ │ └── generated.proto │ │ │ ├── v1beta2 │ │ │ │ └── generated.proto │ │ │ └── v1beta3 │ │ │ │ └── generated.proto │ │ ├── imagepolicy │ │ │ └── v1alpha1 │ │ │ │ └── generated.proto │ │ ├── networking │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── node │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── policy │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── rbac │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── resource │ │ │ ├── v1alpha3 │ │ │ │ └── generated.proto │ │ │ ├── v1beta1 │ │ │ │ └── generated.proto │ │ │ └── v1beta2 │ │ │ │ └── generated.proto │ │ ├── scheduling │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ ├── storage │ │ │ ├── v1 │ │ │ │ └── generated.proto │ │ │ ├── v1alpha1 │ │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ │ └── generated.proto │ │ └── storagemigration │ │ │ └── v1alpha1 │ │ │ └── generated.proto │ ├── apiextensions-apiserver │ │ └── pkg │ │ │ └── apis │ │ │ └── apiextensions │ │ │ ├── v1 │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ └── generated.proto │ ├── apimachinery │ │ └── pkg │ │ │ ├── api │ │ │ └── resource │ │ │ │ └── generated.proto │ │ │ ├── apis │ │ │ ├── meta │ │ │ │ ├── v1 │ │ │ │ │ └── generated.proto │ │ │ │ └── v1beta1 │ │ │ │ │ └── generated.proto │ │ │ └── testapigroup │ │ │ │ └── v1 │ │ │ │ └── generated.proto │ │ │ ├── runtime │ │ │ ├── generated.proto │ │ │ └── schema │ │ │ │ └── generated.proto │ │ │ └── util │ │ │ └── intstr │ │ │ └── generated.proto │ ├── kube-aggregator │ │ └── pkg │ │ │ └── apis │ │ │ └── apiregistration │ │ │ ├── v1 │ │ │ └── generated.proto │ │ │ └── v1beta1 │ │ │ └── generated.proto │ └── metrics │ │ └── pkg │ │ └── apis │ │ ├── custom_metrics │ │ ├── v1beta1 │ │ │ └── generated.proto │ │ └── v1beta2 │ │ │ └── generated.proto │ │ ├── external_metrics │ │ └── v1beta1 │ │ │ └── generated.proto │ │ └── metrics │ │ ├── v1alpha1 │ │ └── generated.proto │ │ └── v1beta1 │ │ └── generated.proto └── src │ ├── lib.rs │ └── main.rs ├── k8s-pb ├── Cargo.toml └── src │ ├── api │ ├── admission │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── admissionregistration │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── apidiscovery │ │ ├── mod.rs │ │ ├── v2 │ │ │ └── mod.rs │ │ └── v2beta1 │ │ │ └── mod.rs │ ├── apiserverinternal │ │ ├── mod.rs │ │ └── v1alpha1 │ │ │ └── mod.rs │ ├── apps │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1beta1 │ │ │ └── mod.rs │ │ └── v1beta2 │ │ │ └── mod.rs │ ├── authentication │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── authorization │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── autoscaling │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v2 │ │ │ └── mod.rs │ │ ├── v2beta1 │ │ │ └── mod.rs │ │ └── v2beta2 │ │ │ └── mod.rs │ ├── batch │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── certificates │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── coordination │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha2 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── core │ │ ├── mod.rs │ │ └── v1 │ │ │ └── mod.rs │ ├── discovery │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── events │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── extensions │ │ ├── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── flowcontrol │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1beta1 │ │ │ └── mod.rs │ │ ├── v1beta2 │ │ │ └── mod.rs │ │ └── v1beta3 │ │ │ └── mod.rs │ ├── imagepolicy │ │ ├── mod.rs │ │ └── v1alpha1 │ │ │ └── mod.rs │ ├── mod.rs │ ├── networking │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── node │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── policy │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── rbac │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── resource │ │ ├── mod.rs │ │ ├── v1alpha3 │ │ │ └── mod.rs │ │ ├── v1beta1 │ │ │ └── mod.rs │ │ └── v1beta2 │ │ │ └── mod.rs │ ├── scheduling │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── storage │ │ ├── mod.rs │ │ ├── v1 │ │ │ └── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ └── storagemigration │ │ ├── mod.rs │ │ └── v1alpha1 │ │ └── mod.rs │ ├── apiextensions_apiserver │ ├── mod.rs │ └── pkg │ │ ├── apis │ │ ├── apiextensions │ │ │ ├── mod.rs │ │ │ ├── v1 │ │ │ │ └── mod.rs │ │ │ └── v1beta1 │ │ │ │ └── mod.rs │ │ └── mod.rs │ │ └── mod.rs │ ├── apimachinery │ ├── mod.rs │ └── pkg │ │ ├── api │ │ ├── mod.rs │ │ └── resource │ │ │ └── mod.rs │ │ ├── apis │ │ ├── meta │ │ │ ├── mod.rs │ │ │ ├── v1 │ │ │ │ └── mod.rs │ │ │ └── v1beta1 │ │ │ │ └── mod.rs │ │ ├── mod.rs │ │ └── testapigroup │ │ │ ├── mod.rs │ │ │ └── v1 │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── runtime │ │ └── mod.rs │ │ └── util │ │ ├── intstr │ │ └── mod.rs │ │ └── mod.rs │ ├── kube_aggregator │ ├── mod.rs │ └── pkg │ │ ├── apis │ │ ├── apiregistration │ │ │ ├── mod.rs │ │ │ ├── v1 │ │ │ │ └── mod.rs │ │ │ └── v1beta1 │ │ │ │ └── mod.rs │ │ └── mod.rs │ │ └── mod.rs │ ├── lib.rs │ └── metrics │ ├── mod.rs │ └── pkg │ ├── apis │ ├── custom_metrics │ │ ├── mod.rs │ │ ├── v1beta1 │ │ │ └── mod.rs │ │ └── v1beta2 │ │ │ └── mod.rs │ ├── external_metrics │ │ ├── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ ├── metrics │ │ ├── mod.rs │ │ ├── v1alpha1 │ │ │ └── mod.rs │ │ └── v1beta1 │ │ │ └── mod.rs │ └── mod.rs │ └── mod.rs ├── release.toml ├── renovate.json5 └── rustfmt.toml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [clux] 4 | #patreon: # Replace with a single Patreon username 5 | #open_collective: # Replace with a single Open Collective username 6 | #ko_fi: # Replace with a single Ko-fi username 7 | #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | #liberapay: # Replace with a single Liberapay username 10 | #issuehunt: # Replace with a single IssueHunt username 11 | #otechie: # Replace with a single Otechie username 12 | #custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | labels: 8 | - "exclude" 9 | 10 | - package-ecosystem: "cargo" 11 | directory: "/" 12 | labels: 13 | - "dependencies" 14 | schedule: 15 | interval: "weekly" 16 | groups: 17 | rust: 18 | patterns: 19 | - .* 20 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes 2 | changelog: 3 | exclude: 4 | labels: [exclude] 5 | categories: 6 | - title: Changes 7 | labels: 8 | - '*' 9 | exclude: 10 | labels: 11 | - dependencies 12 | - title: Dependencies 13 | labels: [dependencies] 14 | -------------------------------------------------------------------------------- /.github/workflows/automerge.yml: -------------------------------------------------------------------------------- 1 | name: Automerge 2 | on: pull_request 3 | 4 | permissions: 5 | contents: write 6 | pull-requests: write 7 | 8 | jobs: 9 | automerge: 10 | runs-on: ubuntu-latest 11 | if: ${{ github.actor == 'sszynrae' || github.actor == 'dependabot[bot]' }} 12 | steps: 13 | - name: Dependabot metadata 14 | id: metadata 15 | uses: dependabot/fetch-metadata@v2 16 | if: ${{ github.actor == 'dependabot[bot]' }} 17 | with: 18 | github-token: "${{ secrets.GITHUB_TOKEN }}" 19 | - name: Approve a PR 20 | run: gh pr review --approve "$PR_URL" 21 | env: 22 | PR_URL: ${{github.event.pull_request.html_url}} 23 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 24 | - name: Enable auto-merge for Dependency/Renovate PRs 25 | run: gh pr merge --auto --squash "$PR_URL" 26 | env: 27 | PR_URL: ${{github.event.pull_request.html_url}} 28 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 29 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | on: 3 | pull_request: 4 | 5 | env: 6 | RUST_BACKTRACE: 1 7 | 8 | # Spend CI time only on latest ref: https://docs.github.com/en/actions/using-jobs/using-concurrency 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | unit: 15 | strategy: 16 | # Prevent GitHub from cancelling all in-progress jobs when a matrix job fails. 17 | fail-fast: false 18 | matrix: 19 | os: [ubuntu-latest, macos-latest, windows-latest] 20 | runs-on: ${{ matrix.os }} 21 | steps: 22 | - uses: actions/checkout@v4 23 | - uses: dtolnay/rust-toolchain@stable 24 | - uses: Swatinem/rust-cache@v2 25 | 26 | # Real CI work starts here 27 | - name: Build workspace 28 | run: cargo build 29 | 30 | - name: Run workspace unit tests 31 | run: cargo test --workspace --lib 32 | - name: Run workspace doc tests 33 | run: cargo test --workspace --doc 34 | if: false # currently go doc generates stuff that rust expects to be valid symbols 35 | 36 | codegen: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v4 40 | # Dependencies 41 | - uses: extractions/setup-just@v3 42 | - uses: arduino/setup-protoc@v3 43 | - name: install fd, sd, ripgrep 44 | run: | 45 | sudo apt-get install -y ripgrep 46 | export FD_VER=10.2.0 47 | export SD_VER=1.0.0 48 | curl -sSL "https://github.com/sharkdp/fd/releases/download/v${FD_VER}/fd-v${FD_VER}-x86_64-unknown-linux-musl.tar.gz" \ 49 | | tar xz --strip-components=1 -C /usr/local/bin/ 50 | curl -sSL "https://github.com/chmln/sd/releases/download/v${SD_VER}/sd-v${SD_VER}-x86_64-unknown-linux-musl.tar.gz" \ 51 | | tar xz --strip-components=1 -C /usr/local/bin/ 52 | # Rust 53 | - uses: dtolnay/rust-toolchain@stable 54 | - uses: Swatinem/rust-cache@v2 55 | # Run codegen step-by-step 56 | - run: just protos 57 | - run: just swagger 58 | - run: just codegen 59 | - run: just names 60 | - name: Ensure generated output is committed 61 | run: | 62 | if ! git diff --exit-code .; then 63 | echo "Uncommitted changes" 64 | echo "Please run codegeneration locally and commit the results" 65 | exit 1 66 | fi 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | default-members = ["k8s-pb"] 3 | members = [ 4 | "k8s-pb-codegen", 5 | "k8s-pb" 6 | ] 7 | resolver = "2" 8 | 9 | [workspace.dependencies] 10 | anyhow = "1.0.98" 11 | env_logger = "0.11.8" 12 | log = "0.4.27" 13 | prost = "0.14.1" 14 | prost-build = "0.14.1" 15 | prost-types = "0.14.1" 16 | quote = "1.0" 17 | serde = "1.0.219" 18 | serde_json = "1.0.140" 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # k8s-pb 2 | [![Crates.io](https://img.shields.io/crates/v/k8s-pb.svg)](https://crates.io/crates/k8s-pb) 3 | 4 | Kubernetes protobuf bindings for [kube-rs](https://github.com/kube-rs). 5 | WIP. Not yet useable as is. 6 | 7 | ## Usage 8 | This library is **not currently usable** from `kube`. 9 | For now consider these structs a reference location for Kubernetes structs that are not found in `k8s-openapi`. 10 | See [docs.rs/k8s-pb](https://docs.rs/k8s-pb/latest/k8s_pb/). 11 | 12 | ## Build Process 13 | The code generation process consists of 4 steps; 14 | 15 | 1. `just protos` - download and patch protobufs 16 | 2. `just swagger` - download and transform openapi schema 17 | 3. `just codegen` - combine info and build with prost 18 | 4. `just names` - case alignment and `cargo fmt` 19 | 20 | This can be run in one step with `just generate`. 21 | 22 | The [k8s-pb](https://github.com/kube-rs/k8s-pb/tree/main/k8s-pb) crate is generated as a result of this process and then published periodically. 23 | 24 | ### just protos 25 | Obtains the [version pinned](https://github.com/kube-rs/k8s-pb/blob/main/justfile#L1) protobufs from upstream: 26 | 27 | - https://github.com/kubernetes/api/releases 28 | - https://github.com/kubernetes/apimachinery/releases 29 | - https://github.com/kubernetes/apiextensions-apiserver/releases 30 | - https://github.com/kubernetes/kube-aggregator/releases 31 | - https://github.com/kubernetes/metrics/releases 32 | 33 | then does [minor transforms](https://github.com/kube-rs/k8s-pb/blob/main/justfile#L19-L34) to prepare them for building. 34 | 35 | ### just swagger 36 | Obtains the [version pinned](https://github.com/kube-rs/k8s-pb/blob/main/justfile#L1) swagger openapi schema from upstream: 37 | 38 | - https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec 39 | 40 | then applies any needed [patches](https://github.com/kube-rs/k8s-pb/tree/main/k8s-pb-codegen/openapi/patches) before [transforming](https://github.com/kube-rs/k8s-pb/blob/main/k8s-pb-codegen/openapi/transform.jq) the schema into a shorter [json file](https://github.com/kube-rs/k8s-pb/blob/main/k8s-pb-codegen/openapi/transformed.json) containing desired generic information. 41 | 42 | This json file complements the protos with type type properties needed for trait implementations. 43 | 44 | ### just codegen 45 | Runs [main.rs](https://github.com/kube-rs/k8s-pb/blob/main/k8s-pb-codegen/src/main.rs), using the outputs from the `swagger` and `protobuf` recipes above. In particular; 46 | 47 | - The protos are built with [prost](https://github.com/tokio-rs/prost) via `protoc` and provides a [`FileDescriptorSet`](https://docs.rs/prost-types/latest/prost_types/struct.FileDescriptorSet.html) via [`Config::file_descriptor_set_path`](https://docs.rs/prost-build/latest/prost_build/struct.Config.html#method.file_descriptor_set_path). 48 | - The transformed swagger result json is deserialized through [lib.rs](https://github.com/kube-rs/k8s-pb/blob/main/k8s-pb-codegen/src/lib.rs) into a `HashMap` where the string is a GVK string. 49 | - inject generics for each modules in hashmap via `append_trait_impl` 50 | - Generate a module tree from the seen modules in the loop 51 | - Attach our implemented traits to the [generated lib.rs](https://github.com/kube-rs/k8s-pb/blob/main/k8s-pb/src/lib.rs) 52 | 53 | ### Build Dependencies 54 | 55 | - [fd](https://github.com/sharkdp/fd) 56 | - [jq](https://stedolan.github.io/jq/) 57 | - [just](https://github.com/casey/just) 58 | - [sd](https://github.com/chmln/sd) 59 | - [ripgrep](https://github.com/BurntSushi/ripgrep) 60 | - [protoc](https://github.com/protocolbuffers/protobuf) 61 | - [rustmft](https://github.com/rust-lang/rustfmt) 62 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | # renovate: datasource=github-releases depName=kubernetes/kubernetes 2 | KUBERNETES_VERSION := "1.33.2" 3 | 4 | export RUST_BACKTRACE := env_var_or_default("RUST_BACKTRACE", "full") 5 | 6 | default: 7 | @just --list 8 | 9 | # Download protos schemas from upstream 10 | protos-dl: 11 | #!/usr/bin/env bash 12 | set -exuo pipefail 13 | cd k8s-pb-codegen 14 | rm -rf protos && mkdir protos && cd protos 15 | for x in api apimachinery apiextensions-apiserver kube-aggregator metrics; do 16 | mkdir -p ./$x 17 | curl -sSL https://github.com/kubernetes/$x/archive/refs/tags/kubernetes-{{KUBERNETES_VERSION}}.tar.gz | tar xzf - -C ./$x/ --strip-components=1 18 | fd -e proto -x sh -c "mkdir -p k8s.io/'{//}'; mv '{}' k8s.io/'{}'" ';' . ./$x 19 | rm -rf ./$x 20 | done 21 | 22 | # Patch protos schemas to fix import paths 23 | protos-patch: 24 | #!/usr/bin/env bash 25 | set -exuo pipefail 26 | cd k8s-pb-codegen 27 | fd -e proto -x sd 'k8s\.io\.(.+);' '$1;' {} 28 | fd -e proto -x sd 'import "k8s\.io/(.+)";' 'import "$1";' {} 29 | mv protos/k8s.io/* protos/ 30 | rmdir protos/k8s.io/ 31 | 32 | # Generate protos path list for prost 33 | protos-list: 34 | #!/usr/bin/env bash 35 | set -exuo pipefail 36 | cd k8s-pb-codegen 37 | sort --version 38 | fd -e proto | sort -fd > protos.list 39 | 40 | # Download and generate all protos dependent files 41 | protos: protos-dl protos-patch protos-list 42 | 43 | # Download swagger 44 | swagger-dl: 45 | #!/usr/bin/env bash 46 | set -exuo pipefail 47 | curl -sSL -o k8s-pb-codegen/openapi/swagger.json \ 48 | https://raw.githubusercontent.com/kubernetes/kubernetes/v{{KUBERNETES_VERSION}}/api/openapi-spec/swagger.json 49 | 50 | # Patch swagger schema for upstream bugs 51 | swagger-patch: 52 | #!/usr/bin/env bash 53 | set -exuo pipefail 54 | cd k8s-pb-codegen/openapi 55 | jq -f patches/patch-nonexistent-gvk.jq < swagger.json > swagger-patched.json 56 | mv swagger-patched.json swagger.json 57 | 58 | # Transform swagger schema into api-resources.json 59 | swagger-transform: 60 | #!/usr/bin/env bash 61 | set -exuo pipefail 62 | cd k8s-pb-codegen/openapi 63 | jq -f transform.jq < swagger.json > transformed.json 64 | 65 | # Download and generate all swagger dependent files 66 | swagger: swagger-dl swagger-patch swagger-transform 67 | 68 | # Generate the library code from completed swagger and protos 69 | codegen: 70 | #!/usr/bin/env bash 71 | set -exuo pipefail 72 | rm -rf k8s-pb/src && mkdir k8s-pb/src 73 | # src/lib.rs must exist to `cargo run` 74 | touch k8s-pb/src/lib.rs 75 | cd k8s-pb-codegen 76 | rm -rf tmp/ && mkdir tmp 77 | cargo run 78 | 79 | # Align names and format 80 | names: 81 | #!/usr/bin/env bash 82 | # Retain original names (prost doesn't let you bypass its renaming) 83 | rg 'ApiService' k8s-pb -l | xargs sd 'ApiService' 'APIService' 84 | rg 'ApiResource' k8s-pb -l | xargs sd 'ApiResource' 'APIResource' 85 | rg 'ApiGroup' k8s-pb -l | xargs sd 'ApiGroup' 'APIGroup' 86 | rg 'ApiVersion' k8s-pb -l | xargs sd 'ApiVersion' 'APIVersion' 87 | rg 'ApiSubresource' k8s-pb -l | xargs sd 'ApiSubresource' 'APISubresource' 88 | rg 'DownwardApi' k8s-pb -l | xargs sd 'DownwardApi' 'DownwardAPI' 89 | rg 'CsiDriver' k8s-pb -l | xargs sd 'CsiDriver' 'CSIDriver' 90 | rg 'CsiPersistent' k8s-pb -l | xargs sd 'CsiPersistent' 'CSIPersistent' 91 | rg 'CsiVolume' k8s-pb -l | xargs sd 'CsiVolume' 'CSIVolume' 92 | rg 'CsiStorage' k8s-pb -l | xargs sd 'CsiStorage' 'CSIStorage' 93 | rg 'CsiNode' k8s-pb -l | xargs sd 'CsiNode' 'CSINode' 94 | rg 'IpAddress' k8s-pb -l | xargs sd 'IpAddress' 'IPAddress' 95 | rg 'ServiceCidr' k8s-pb -l | xargs sd 'ServiceCidr' 'ServiceCIDR' 96 | rg 'ClusterCidr' k8s-pb -l | xargs sd 'ClusterCidr' 'ClusterCIDR' 97 | rg 'ClientCidr' k8s-pb -l | xargs sd 'ClientCidr' 'ClientCIDR' 98 | rg 'cluster_i_ps' k8s-pb -l | xargs sd 'cluster_i_ps' 'cluster_ips' 99 | rg 'external_i_ps' k8s-pb -l | xargs sd 'external_i_ps' 'external_ips' 100 | rg 'pod_i_ps' k8s-pb -l | xargs sd 'pod_i_ps' 'pod_ips' 101 | rg 'host_i_ps' k8s-pb -l | xargs sd 'host_i_ps' 'host_ips' 102 | cargo fmt 103 | 104 | generate: swagger protos codegen names 105 | -------------------------------------------------------------------------------- /k8s-pb-codegen/.gitignore: -------------------------------------------------------------------------------- 1 | protos.fds 2 | tmp/ 3 | -------------------------------------------------------------------------------- /k8s-pb-codegen/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "k8s-pb-codegen" 3 | version = "0.3.0" 4 | edition = "2021" 5 | license = "Apache-2.0" 6 | publish = false 7 | 8 | [dependencies] 9 | prost = { workspace = true } 10 | prost-build = { workspace = true } 11 | prost-types = { workspace = true } 12 | serde_json = { workspace = true } 13 | serde = { workspace = true, features = ["derive"] } 14 | log = { workspace = true } 15 | anyhow = { workspace = true } 16 | env_logger = { workspace = true } 17 | quote = { workspace = true } 18 | -------------------------------------------------------------------------------- /k8s-pb-codegen/openapi/patches/patch-nonexistent-gvk.jq: -------------------------------------------------------------------------------- 1 | # Fix path operation annotated with a `x-kubernetes-group-version-kind` that references a type that doesn't exist in the schema. 2 | # See https://github.com/Arnavion/k8s-openapi/blob/445e89ec444ebb1c68e61361e64eec4c4a3f4785/k8s-openapi-codegen/src/fixups/upstream_bugs.rs#L9 3 | (.paths | .. | objects | select((.group? == "") and (.version? == "v1") and (.kind? | type) == "string")).kind |= ( 4 | if . | test("^Pod(?:Attach|Exec|PortForward|Proxy)Options$") then 5 | "Pod" 6 | elif . == "NodeProxyOptions" then 7 | "Node" 8 | elif . == "ServiceProxyOptions" then 9 | "Service" 10 | else 11 | . 12 | end 13 | ) 14 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos.list: -------------------------------------------------------------------------------- 1 | protos/api/admissionregistration/v1alpha1/generated.proto 2 | protos/api/admissionregistration/v1beta1/generated.proto 3 | protos/api/admissionregistration/v1/generated.proto 4 | protos/api/admission/v1beta1/generated.proto 5 | protos/api/admission/v1/generated.proto 6 | protos/api/apidiscovery/v2beta1/generated.proto 7 | protos/api/apidiscovery/v2/generated.proto 8 | protos/api/apiserverinternal/v1alpha1/generated.proto 9 | protos/api/apps/v1beta1/generated.proto 10 | protos/api/apps/v1beta2/generated.proto 11 | protos/api/apps/v1/generated.proto 12 | protos/api/authentication/v1alpha1/generated.proto 13 | protos/api/authentication/v1beta1/generated.proto 14 | protos/api/authentication/v1/generated.proto 15 | protos/api/authorization/v1beta1/generated.proto 16 | protos/api/authorization/v1/generated.proto 17 | protos/api/autoscaling/v1/generated.proto 18 | protos/api/autoscaling/v2beta1/generated.proto 19 | protos/api/autoscaling/v2beta2/generated.proto 20 | protos/api/autoscaling/v2/generated.proto 21 | protos/api/batch/v1beta1/generated.proto 22 | protos/api/batch/v1/generated.proto 23 | protos/api/certificates/v1alpha1/generated.proto 24 | protos/api/certificates/v1beta1/generated.proto 25 | protos/api/certificates/v1/generated.proto 26 | protos/api/coordination/v1alpha2/generated.proto 27 | protos/api/coordination/v1beta1/generated.proto 28 | protos/api/coordination/v1/generated.proto 29 | protos/api/core/v1/generated.proto 30 | protos/api/discovery/v1beta1/generated.proto 31 | protos/api/discovery/v1/generated.proto 32 | protos/api/events/v1beta1/generated.proto 33 | protos/api/events/v1/generated.proto 34 | protos/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto 35 | protos/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto 36 | protos/api/extensions/v1beta1/generated.proto 37 | protos/api/flowcontrol/v1beta1/generated.proto 38 | protos/api/flowcontrol/v1beta2/generated.proto 39 | protos/api/flowcontrol/v1beta3/generated.proto 40 | protos/api/flowcontrol/v1/generated.proto 41 | protos/api/imagepolicy/v1alpha1/generated.proto 42 | protos/apimachinery/pkg/api/resource/generated.proto 43 | protos/apimachinery/pkg/apis/meta/v1beta1/generated.proto 44 | protos/apimachinery/pkg/apis/meta/v1/generated.proto 45 | protos/apimachinery/pkg/apis/testapigroup/v1/generated.proto 46 | protos/apimachinery/pkg/runtime/generated.proto 47 | protos/apimachinery/pkg/runtime/schema/generated.proto 48 | protos/apimachinery/pkg/util/intstr/generated.proto 49 | protos/api/networking/v1alpha1/generated.proto 50 | protos/api/networking/v1beta1/generated.proto 51 | protos/api/networking/v1/generated.proto 52 | protos/api/node/v1alpha1/generated.proto 53 | protos/api/node/v1beta1/generated.proto 54 | protos/api/node/v1/generated.proto 55 | protos/api/policy/v1beta1/generated.proto 56 | protos/api/policy/v1/generated.proto 57 | protos/api/rbac/v1alpha1/generated.proto 58 | protos/api/rbac/v1beta1/generated.proto 59 | protos/api/rbac/v1/generated.proto 60 | protos/api/resource/v1alpha3/generated.proto 61 | protos/api/resource/v1beta1/generated.proto 62 | protos/api/resource/v1beta2/generated.proto 63 | protos/api/scheduling/v1alpha1/generated.proto 64 | protos/api/scheduling/v1beta1/generated.proto 65 | protos/api/scheduling/v1/generated.proto 66 | protos/api/storagemigration/v1alpha1/generated.proto 67 | protos/api/storage/v1alpha1/generated.proto 68 | protos/api/storage/v1beta1/generated.proto 69 | protos/api/storage/v1/generated.proto 70 | protos/kube-aggregator/pkg/apis/apiregistration/v1beta1/generated.proto 71 | protos/kube-aggregator/pkg/apis/apiregistration/v1/generated.proto 72 | protos/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto 73 | protos/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto 74 | protos/metrics/pkg/apis/external_metrics/v1beta1/generated.proto 75 | protos/metrics/pkg/apis/metrics/v1alpha1/generated.proto 76 | protos/metrics/pkg/apis/metrics/v1beta1/generated.proto 77 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/apiserverinternal/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.apiserverinternal.v1alpha1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/generated.proto"; 26 | import "apimachinery/pkg/runtime/schema/generated.proto"; 27 | 28 | // Package-wide variables from generator "generated". 29 | option go_package = "k8s.io/api/apiserverinternal/v1alpha1"; 30 | 31 | // An API server instance reports the version it can decode and the version it 32 | // encodes objects to when persisting objects in the backend. 33 | message ServerStorageVersion { 34 | // The ID of the reporting API server. 35 | optional string apiServerID = 1; 36 | 37 | // The API server encodes the object to this version when persisting it in 38 | // the backend (e.g., etcd). 39 | optional string encodingVersion = 2; 40 | 41 | // The API server can decode objects encoded in these versions. 42 | // The encodingVersion must be included in the decodableVersions. 43 | // +listType=set 44 | repeated string decodableVersions = 3; 45 | 46 | // The API server can serve these versions. 47 | // DecodableVersions must include all ServedVersions. 48 | // +listType=set 49 | repeated string servedVersions = 4; 50 | } 51 | 52 | // Storage version of a specific resource. 53 | message StorageVersion { 54 | // The name is .. 55 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 56 | 57 | // Spec is an empty spec. It is here to comply with Kubernetes API style. 58 | optional StorageVersionSpec spec = 2; 59 | 60 | // API server instances report the version they can decode and the version they 61 | // encode objects to when persisting objects in the backend. 62 | optional StorageVersionStatus status = 3; 63 | } 64 | 65 | // Describes the state of the storageVersion at a certain point. 66 | message StorageVersionCondition { 67 | // Type of the condition. 68 | // +required 69 | optional string type = 1; 70 | 71 | // Status of the condition, one of True, False, Unknown. 72 | // +required 73 | optional string status = 2; 74 | 75 | // If set, this represents the .metadata.generation that the condition was set based upon. 76 | // +optional 77 | optional int64 observedGeneration = 3; 78 | 79 | // Last time the condition transitioned from one status to another. 80 | optional .apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; 81 | 82 | // The reason for the condition's last transition. 83 | // +required 84 | optional string reason = 5; 85 | 86 | // A human readable message indicating details about the transition. 87 | // +required 88 | optional string message = 6; 89 | } 90 | 91 | // A list of StorageVersions. 92 | message StorageVersionList { 93 | // Standard list metadata. 94 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 95 | // +optional 96 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 97 | 98 | // Items holds a list of StorageVersion 99 | repeated StorageVersion items = 2; 100 | } 101 | 102 | // StorageVersionSpec is an empty spec. 103 | message StorageVersionSpec { 104 | } 105 | 106 | // API server instances report the versions they can decode and the version they 107 | // encode objects to when persisting objects in the backend. 108 | message StorageVersionStatus { 109 | // The reported versions per API server instance. 110 | // +optional 111 | // +listType=map 112 | // +listMapKey=apiServerID 113 | repeated ServerStorageVersion storageVersions = 1; 114 | 115 | // If all API server instances agree on the same encoding storage version, 116 | // then this field is set to that version. Otherwise this field is left empty. 117 | // API servers should finish updating its storageVersionStatus entry before 118 | // serving write operations, so that this field will be in sync with the reality. 119 | // +optional 120 | optional string commonEncodingVersion = 2; 121 | 122 | // The latest available observations of the storageVersion's state. 123 | // +optional 124 | // +listType=map 125 | // +listMapKey=type 126 | repeated StorageVersionCondition conditions = 3; 127 | } 128 | 129 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/authentication/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.authentication.v1alpha1; 23 | 24 | import "api/authentication/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/authentication/v1alpha1"; 31 | 32 | // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. 33 | // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or 34 | // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. 35 | message SelfSubjectReview { 36 | // Standard object's metadata. 37 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 38 | // +optional 39 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 40 | 41 | // Status is filled in by the server with the user attributes. 42 | optional SelfSubjectReviewStatus status = 2; 43 | } 44 | 45 | // SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. 46 | message SelfSubjectReviewStatus { 47 | // User attributes of the user making this request. 48 | // +optional 49 | optional .api.authentication.v1.UserInfo userInfo = 1; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/authentication/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.authentication.v1beta1; 23 | 24 | import "api/authentication/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/authentication/v1beta1"; 31 | 32 | // ExtraValue masks the value so protobuf can generate 33 | // +protobuf.nullable=true 34 | // +protobuf.options.(gogoproto.goproto_stringer)=false 35 | message ExtraValue { 36 | // items, if empty, will result in an empty slice 37 | 38 | repeated string items = 1; 39 | } 40 | 41 | // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. 42 | // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or 43 | // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. 44 | message SelfSubjectReview { 45 | // Standard object's metadata. 46 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 47 | // +optional 48 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 49 | 50 | // Status is filled in by the server with the user attributes. 51 | optional SelfSubjectReviewStatus status = 2; 52 | } 53 | 54 | // SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. 55 | message SelfSubjectReviewStatus { 56 | // User attributes of the user making this request. 57 | // +optional 58 | optional .api.authentication.v1.UserInfo userInfo = 1; 59 | } 60 | 61 | // TokenReview attempts to authenticate a token to a known user. 62 | // Note: TokenReview requests may be cached by the webhook token authenticator 63 | // plugin in the kube-apiserver. 64 | message TokenReview { 65 | // Standard object's metadata. 66 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 67 | // +optional 68 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 69 | 70 | // Spec holds information about the request being evaluated 71 | optional TokenReviewSpec spec = 2; 72 | 73 | // Status is filled in by the server and indicates whether the token can be authenticated. 74 | // +optional 75 | optional TokenReviewStatus status = 3; 76 | } 77 | 78 | // TokenReviewSpec is a description of the token authentication request. 79 | message TokenReviewSpec { 80 | // Token is the opaque bearer token. 81 | // +optional 82 | optional string token = 1; 83 | 84 | // Audiences is a list of the identifiers that the resource server presented 85 | // with the token identifies as. Audience-aware token authenticators will 86 | // verify that the token was intended for at least one of the audiences in 87 | // this list. If no audiences are provided, the audience will default to the 88 | // audience of the Kubernetes apiserver. 89 | // +optional 90 | // +listType=atomic 91 | repeated string audiences = 2; 92 | } 93 | 94 | // TokenReviewStatus is the result of the token authentication request. 95 | message TokenReviewStatus { 96 | // Authenticated indicates that the token was associated with a known user. 97 | // +optional 98 | optional bool authenticated = 1; 99 | 100 | // User is the UserInfo associated with the provided token. 101 | // +optional 102 | optional UserInfo user = 2; 103 | 104 | // Audiences are audience identifiers chosen by the authenticator that are 105 | // compatible with both the TokenReview and token. An identifier is any 106 | // identifier in the intersection of the TokenReviewSpec audiences and the 107 | // token's audiences. A client of the TokenReview API that sets the 108 | // spec.audiences field should validate that a compatible audience identifier 109 | // is returned in the status.audiences field to ensure that the TokenReview 110 | // server is audience aware. If a TokenReview returns an empty 111 | // status.audience field where status.authenticated is "true", the token is 112 | // valid against the audience of the Kubernetes API server. 113 | // +optional 114 | // +listType=atomic 115 | repeated string audiences = 4; 116 | 117 | // Error indicates that the token couldn't be checked 118 | // +optional 119 | optional string error = 3; 120 | } 121 | 122 | // UserInfo holds the information about the user needed to implement the 123 | // user.Info interface. 124 | message UserInfo { 125 | // The name that uniquely identifies this user among all active users. 126 | // +optional 127 | optional string username = 1; 128 | 129 | // A unique value that identifies this user across time. If this user is 130 | // deleted and another user by the same name is added, they will have 131 | // different UIDs. 132 | // +optional 133 | optional string uid = 2; 134 | 135 | // The names of groups this user is a part of. 136 | // +optional 137 | // +listType=atomic 138 | repeated string groups = 3; 139 | 140 | // Any additional information provided by the authenticator. 141 | // +optional 142 | map extra = 4; 143 | } 144 | 145 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/batch/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.batch.v1beta1; 23 | 24 | import "api/batch/v1/generated.proto"; 25 | import "api/core/v1/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/api/batch/v1beta1"; 32 | 33 | // CronJob represents the configuration of a single cron job. 34 | message CronJob { 35 | // Standard object's metadata. 36 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 37 | // +optional 38 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 39 | 40 | // Specification of the desired behavior of a cron job, including the schedule. 41 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 42 | // +optional 43 | optional CronJobSpec spec = 2; 44 | 45 | // Current status of a cron job. 46 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 47 | // +optional 48 | optional CronJobStatus status = 3; 49 | } 50 | 51 | // CronJobList is a collection of cron jobs. 52 | message CronJobList { 53 | // Standard list metadata. 54 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 55 | // +optional 56 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 57 | 58 | // items is the list of CronJobs. 59 | repeated CronJob items = 2; 60 | } 61 | 62 | // CronJobSpec describes how the job execution will look like and when it will actually run. 63 | message CronJobSpec { 64 | // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. 65 | optional string schedule = 1; 66 | 67 | // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. 68 | // If not specified, this will default to the time zone of the kube-controller-manager process. 69 | // The set of valid time zone names and the time zone offset is loaded from the system-wide time zone 70 | // database by the API server during CronJob validation and the controller manager during execution. 71 | // If no system-wide time zone database can be found a bundled version of the database is used instead. 72 | // If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host 73 | // configuration, the controller will stop creating new new Jobs and will create a system event with the 74 | // reason UnknownTimeZone. 75 | // More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones 76 | // +optional 77 | optional string timeZone = 8; 78 | 79 | // Optional deadline in seconds for starting the job if it misses scheduled 80 | // time for any reason. Missed jobs executions will be counted as failed ones. 81 | // +optional 82 | optional int64 startingDeadlineSeconds = 2; 83 | 84 | // Specifies how to treat concurrent executions of a Job. 85 | // Valid values are: 86 | // 87 | // - "Allow" (default): allows CronJobs to run concurrently; 88 | // - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; 89 | // - "Replace": cancels currently running job and replaces it with a new one 90 | // +optional 91 | optional string concurrencyPolicy = 3; 92 | 93 | // This flag tells the controller to suspend subsequent executions, it does 94 | // not apply to already started executions. Defaults to false. 95 | // +optional 96 | optional bool suspend = 4; 97 | 98 | // Specifies the job that will be created when executing a CronJob. 99 | optional JobTemplateSpec jobTemplate = 5; 100 | 101 | // The number of successful finished jobs to retain. 102 | // This is a pointer to distinguish between explicit zero and not specified. 103 | // Defaults to 3. 104 | // +optional 105 | optional int32 successfulJobsHistoryLimit = 6; 106 | 107 | // The number of failed finished jobs to retain. 108 | // This is a pointer to distinguish between explicit zero and not specified. 109 | // Defaults to 1. 110 | // +optional 111 | optional int32 failedJobsHistoryLimit = 7; 112 | } 113 | 114 | // CronJobStatus represents the current state of a cron job. 115 | message CronJobStatus { 116 | // A list of pointers to currently running jobs. 117 | // +optional 118 | // +listType=atomic 119 | repeated .api.core.v1.ObjectReference active = 1; 120 | 121 | // Information when was the last time the job was successfully scheduled. 122 | // +optional 123 | optional .apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; 124 | 125 | // Information when was the last time the job successfully completed. 126 | // +optional 127 | optional .apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5; 128 | } 129 | 130 | // JobTemplateSpec describes the data a Job should have when created from a template 131 | message JobTemplateSpec { 132 | // Standard object's metadata of the jobs created from this template. 133 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 134 | // +optional 135 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 136 | 137 | // Specification of the desired behavior of the job. 138 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 139 | // +optional 140 | optional .api.batch.v1.JobSpec spec = 2; 141 | } 142 | 143 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/certificates/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.certificates.v1alpha1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/generated.proto"; 26 | import "apimachinery/pkg/runtime/schema/generated.proto"; 27 | 28 | // Package-wide variables from generator "generated". 29 | option go_package = "k8s.io/api/certificates/v1alpha1"; 30 | 31 | // ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors 32 | // (root certificates). 33 | // 34 | // ClusterTrustBundle objects are considered to be readable by any authenticated 35 | // user in the cluster, because they can be mounted by pods using the 36 | // `clusterTrustBundle` projection. All service accounts have read access to 37 | // ClusterTrustBundles by default. Users who only have namespace-level access 38 | // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount 39 | // that they have access to. 40 | // 41 | // It can be optionally associated with a particular assigner, in which case it 42 | // contains one valid set of trust anchors for that signer. Signers may have 43 | // multiple associated ClusterTrustBundles; each is an independent set of trust 44 | // anchors for that signer. Admission control is used to enforce that only users 45 | // with permissions on the signer can create or modify the corresponding bundle. 46 | message ClusterTrustBundle { 47 | // metadata contains the object metadata. 48 | // +optional 49 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 50 | 51 | // spec contains the signer (if any) and trust anchors. 52 | optional ClusterTrustBundleSpec spec = 2; 53 | } 54 | 55 | // ClusterTrustBundleList is a collection of ClusterTrustBundle objects 56 | message ClusterTrustBundleList { 57 | // metadata contains the list metadata. 58 | // 59 | // +optional 60 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 61 | 62 | // items is a collection of ClusterTrustBundle objects 63 | repeated ClusterTrustBundle items = 2; 64 | } 65 | 66 | // ClusterTrustBundleSpec contains the signer and trust anchors. 67 | message ClusterTrustBundleSpec { 68 | // signerName indicates the associated signer, if any. 69 | // 70 | // In order to create or update a ClusterTrustBundle that sets signerName, 71 | // you must have the following cluster-scoped permission: 72 | // group=certificates.k8s.io resource=signers resourceName= 73 | // verb=attest. 74 | // 75 | // If signerName is not empty, then the ClusterTrustBundle object must be 76 | // named with the signer name as a prefix (translating slashes to colons). 77 | // For example, for the signer name `example.com/foo`, valid 78 | // ClusterTrustBundle object names include `example.com:foo:abc` and 79 | // `example.com:foo:v1`. 80 | // 81 | // If signerName is empty, then the ClusterTrustBundle object's name must 82 | // not have such a prefix. 83 | // 84 | // List/watch requests for ClusterTrustBundles can filter on this field 85 | // using a `spec.signerName=NAME` field selector. 86 | // 87 | // +optional 88 | optional string signerName = 1; 89 | 90 | // trustBundle contains the individual X.509 trust anchors for this 91 | // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. 92 | // 93 | // The data must consist only of PEM certificate blocks that parse as valid 94 | // X.509 certificates. Each certificate must include a basic constraints 95 | // extension with the CA bit set. The API server will reject objects that 96 | // contain duplicate certificates, or that use PEM block headers. 97 | // 98 | // Users of ClusterTrustBundles, including Kubelet, are free to reorder and 99 | // deduplicate certificate blocks in this file according to their own logic, 100 | // as well as to drop PEM block headers and inter-block data. 101 | optional string trustBundle = 2; 102 | } 103 | 104 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/coordination/v1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.coordination.v1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/generated.proto"; 26 | import "apimachinery/pkg/runtime/schema/generated.proto"; 27 | 28 | // Package-wide variables from generator "generated". 29 | option go_package = "k8s.io/api/coordination/v1"; 30 | 31 | // Lease defines a lease concept. 32 | message Lease { 33 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 34 | // +optional 35 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 36 | 37 | // spec contains the specification of the Lease. 38 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 39 | // +optional 40 | optional LeaseSpec spec = 2; 41 | } 42 | 43 | // LeaseList is a list of Lease objects. 44 | message LeaseList { 45 | // Standard list metadata. 46 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 47 | // +optional 48 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 49 | 50 | // items is a list of schema objects. 51 | repeated Lease items = 2; 52 | } 53 | 54 | // LeaseSpec is a specification of a Lease. 55 | message LeaseSpec { 56 | // holderIdentity contains the identity of the holder of a current lease. 57 | // If Coordinated Leader Election is used, the holder identity must be 58 | // equal to the elected LeaseCandidate.metadata.name field. 59 | // +optional 60 | optional string holderIdentity = 1; 61 | 62 | // leaseDurationSeconds is a duration that candidates for a lease need 63 | // to wait to force acquire it. This is measured against the time of last 64 | // observed renewTime. 65 | // +optional 66 | optional int32 leaseDurationSeconds = 2; 67 | 68 | // acquireTime is a time when the current lease was acquired. 69 | // +optional 70 | optional .apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3; 71 | 72 | // renewTime is a time when the current holder of a lease has last 73 | // updated the lease. 74 | // +optional 75 | optional .apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4; 76 | 77 | // leaseTransitions is the number of transitions of a lease between 78 | // holders. 79 | // +optional 80 | optional int32 leaseTransitions = 5; 81 | 82 | // Strategy indicates the strategy for picking the leader for coordinated leader election. 83 | // If the field is not specified, there is no active coordination for this lease. 84 | // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. 85 | // +featureGate=CoordinatedLeaderElection 86 | // +optional 87 | optional string strategy = 6; 88 | 89 | // PreferredHolder signals to a lease holder that the lease has a 90 | // more optimal holder and should be given up. 91 | // This field can only be set if Strategy is also set. 92 | // +featureGate=CoordinatedLeaderElection 93 | // +optional 94 | optional string preferredHolder = 7; 95 | } 96 | 97 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/coordination/v1alpha2/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.coordination.v1alpha2; 23 | 24 | import "api/coordination/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/coordination/v1alpha2"; 31 | 32 | // LeaseCandidate defines a candidate for a Lease object. 33 | // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. 34 | message LeaseCandidate { 35 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 36 | // +optional 37 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 38 | 39 | // spec contains the specification of the Lease. 40 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 41 | // +optional 42 | optional LeaseCandidateSpec spec = 2; 43 | } 44 | 45 | // LeaseCandidateList is a list of Lease objects. 46 | message LeaseCandidateList { 47 | // Standard list metadata. 48 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 49 | // +optional 50 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 51 | 52 | // items is a list of schema objects. 53 | repeated LeaseCandidate items = 2; 54 | } 55 | 56 | // LeaseCandidateSpec is a specification of a Lease. 57 | message LeaseCandidateSpec { 58 | // LeaseName is the name of the lease for which this candidate is contending. 59 | // This field is immutable. 60 | // +required 61 | optional string leaseName = 1; 62 | 63 | // PingTime is the last time that the server has requested the LeaseCandidate 64 | // to renew. It is only done during leader election to check if any 65 | // LeaseCandidates have become ineligible. When PingTime is updated, the 66 | // LeaseCandidate will respond by updating RenewTime. 67 | // +optional 68 | optional .apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2; 69 | 70 | // RenewTime is the time that the LeaseCandidate was last updated. 71 | // Any time a Lease needs to do leader election, the PingTime field 72 | // is updated to signal to the LeaseCandidate that they should update 73 | // the RenewTime. 74 | // Old LeaseCandidate objects are also garbage collected if it has been hours 75 | // since the last renew. The PingTime field is updated regularly to prevent 76 | // garbage collection for still active LeaseCandidates. 77 | // +optional 78 | optional .apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3; 79 | 80 | // BinaryVersion is the binary version. It must be in a semver format without leading `v`. 81 | // This field is required. 82 | // +required 83 | optional string binaryVersion = 4; 84 | 85 | // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. 86 | // EmulationVersion must be less than or equal to BinaryVersion. 87 | // This field is required when strategy is "OldestEmulationVersion" 88 | // +optional 89 | optional string emulationVersion = 5; 90 | 91 | // Strategy is the strategy that coordinated leader election will use for picking the leader. 92 | // If multiple candidates for the same Lease return different strategies, the strategy provided 93 | // by the candidate with the latest BinaryVersion will be used. If there is still conflict, 94 | // this is a user error and coordinated leader election will not operate the Lease until resolved. 95 | // +required 96 | optional string strategy = 6; 97 | } 98 | 99 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/events/v1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.events.v1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/events/v1"; 31 | 32 | // Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. 33 | // Events have a limited retention time and triggers and messages may evolve 34 | // with time. Event consumers should not rely on the timing of an event 35 | // with a given Reason reflecting a consistent underlying trigger, or the 36 | // continued existence of events with that Reason. Events should be 37 | // treated as informative, best-effort, supplemental data. 38 | message Event { 39 | // Standard object's metadata. 40 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 41 | // +optional 42 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 43 | 44 | // eventTime is the time when this Event was first observed. It is required. 45 | optional .apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2; 46 | 47 | // series is data about the Event series this event represents or nil if it's a singleton Event. 48 | // +optional 49 | optional EventSeries series = 3; 50 | 51 | // reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 52 | // This field cannot be empty for new Events. 53 | optional string reportingController = 4; 54 | 55 | // reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`. 56 | // This field cannot be empty for new Events and it can have at most 128 characters. 57 | optional string reportingInstance = 5; 58 | 59 | // action is what action was taken/failed regarding to the regarding object. It is machine-readable. 60 | // This field cannot be empty for new Events and it can have at most 128 characters. 61 | optional string action = 6; 62 | 63 | // reason is why the action was taken. It is human-readable. 64 | // This field cannot be empty for new Events and it can have at most 128 characters. 65 | optional string reason = 7; 66 | 67 | // regarding contains the object this Event is about. In most cases it's an Object reporting controller 68 | // implements, e.g. ReplicaSetController implements ReplicaSets and this event is emitted because 69 | // it acts on some changes in a ReplicaSet object. 70 | // +optional 71 | optional .api.core.v1.ObjectReference regarding = 8; 72 | 73 | // related is the optional secondary object for more complex actions. E.g. when regarding object triggers 74 | // a creation or deletion of related object. 75 | // +optional 76 | optional .api.core.v1.ObjectReference related = 9; 77 | 78 | // note is a human-readable description of the status of this operation. 79 | // Maximal length of the note is 1kB, but libraries should be prepared to 80 | // handle values up to 64kB. 81 | // +optional 82 | optional string note = 10; 83 | 84 | // type is the type of this event (Normal, Warning), new types could be added in the future. 85 | // It is machine-readable. 86 | // This field cannot be empty for new Events. 87 | optional string type = 11; 88 | 89 | // deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type. 90 | // +optional 91 | optional .api.core.v1.EventSource deprecatedSource = 12; 92 | 93 | // deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. 94 | // +optional 95 | optional .apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13; 96 | 97 | // deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. 98 | // +optional 99 | optional .apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14; 100 | 101 | // deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type. 102 | // +optional 103 | optional int32 deprecatedCount = 15; 104 | } 105 | 106 | // EventList is a list of Event objects. 107 | message EventList { 108 | // Standard list metadata. 109 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 110 | // +optional 111 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 112 | 113 | // items is a list of schema objects. 114 | repeated Event items = 2; 115 | } 116 | 117 | // EventSeries contain information on series of events, i.e. thing that was/is happening 118 | // continuously for some time. How often to update the EventSeries is up to the event reporters. 119 | // The default event reporter in "k8s.io/client-go/tools/events/event_broadcaster.go" shows 120 | // how this struct is updated on heartbeats and can guide customized reporter implementations. 121 | message EventSeries { 122 | // count is the number of occurrences in this series up to the last heartbeat time. 123 | optional int32 count = 1; 124 | 125 | // lastObservedTime is the time when last Event from the series was seen before last heartbeat. 126 | optional .apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2; 127 | } 128 | 129 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/events/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.events.v1beta1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/events/v1beta1"; 31 | 32 | // Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. 33 | // Events have a limited retention time and triggers and messages may evolve 34 | // with time. Event consumers should not rely on the timing of an event 35 | // with a given Reason reflecting a consistent underlying trigger, or the 36 | // continued existence of events with that Reason. Events should be 37 | // treated as informative, best-effort, supplemental data. 38 | message Event { 39 | // Standard object's metadata. 40 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 41 | // +optional 42 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 43 | 44 | // eventTime is the time when this Event was first observed. It is required. 45 | optional .apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2; 46 | 47 | // series is data about the Event series this event represents or nil if it's a singleton Event. 48 | // +optional 49 | optional EventSeries series = 3; 50 | 51 | // reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 52 | // This field cannot be empty for new Events. 53 | // +optional 54 | optional string reportingController = 4; 55 | 56 | // reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`. 57 | // This field cannot be empty for new Events and it can have at most 128 characters. 58 | // +optional 59 | optional string reportingInstance = 5; 60 | 61 | // action is what action was taken/failed regarding to the regarding object. It is machine-readable. 62 | // This field can have at most 128 characters. 63 | // +optional 64 | optional string action = 6; 65 | 66 | // reason is why the action was taken. It is human-readable. 67 | // This field can have at most 128 characters. 68 | // +optional 69 | optional string reason = 7; 70 | 71 | // regarding contains the object this Event is about. In most cases it's an Object reporting controller 72 | // implements, e.g. ReplicaSetController implements ReplicaSets and this event is emitted because 73 | // it acts on some changes in a ReplicaSet object. 74 | // +optional 75 | optional .api.core.v1.ObjectReference regarding = 8; 76 | 77 | // related is the optional secondary object for more complex actions. E.g. when regarding object triggers 78 | // a creation or deletion of related object. 79 | // +optional 80 | optional .api.core.v1.ObjectReference related = 9; 81 | 82 | // note is a human-readable description of the status of this operation. 83 | // Maximal length of the note is 1kB, but libraries should be prepared to 84 | // handle values up to 64kB. 85 | // +optional 86 | optional string note = 10; 87 | 88 | // type is the type of this event (Normal, Warning), new types could be added in the future. 89 | // It is machine-readable. 90 | // +optional 91 | optional string type = 11; 92 | 93 | // deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type. 94 | // +optional 95 | optional .api.core.v1.EventSource deprecatedSource = 12; 96 | 97 | // deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. 98 | // +optional 99 | optional .apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13; 100 | 101 | // deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. 102 | // +optional 103 | optional .apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14; 104 | 105 | // deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type. 106 | // +optional 107 | optional int32 deprecatedCount = 15; 108 | } 109 | 110 | // EventList is a list of Event objects. 111 | message EventList { 112 | // Standard list metadata. 113 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 114 | // +optional 115 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 116 | 117 | // items is a list of schema objects. 118 | repeated Event items = 2; 119 | } 120 | 121 | // EventSeries contain information on series of events, i.e. thing that was/is happening 122 | // continuously for some time. 123 | message EventSeries { 124 | // count is the number of occurrences in this series up to the last heartbeat time. 125 | optional int32 count = 1; 126 | 127 | // lastObservedTime is the time when last Event from the series was seen before last heartbeat. 128 | optional .apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2; 129 | } 130 | 131 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/imagepolicy/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.imagepolicy.v1alpha1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/generated.proto"; 26 | import "apimachinery/pkg/runtime/schema/generated.proto"; 27 | 28 | // Package-wide variables from generator "generated". 29 | option go_package = "k8s.io/api/imagepolicy/v1alpha1"; 30 | 31 | // ImageReview checks if the set of images in a pod are allowed. 32 | message ImageReview { 33 | // Standard object's metadata. 34 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 35 | // +optional 36 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 37 | 38 | // Spec holds information about the pod being evaluated 39 | optional ImageReviewSpec spec = 2; 40 | 41 | // Status is filled in by the backend and indicates whether the pod should be allowed. 42 | // +optional 43 | optional ImageReviewStatus status = 3; 44 | } 45 | 46 | // ImageReviewContainerSpec is a description of a container within the pod creation request. 47 | message ImageReviewContainerSpec { 48 | // This can be in the form image:tag or image@SHA:012345679abcdef. 49 | // +optional 50 | optional string image = 1; 51 | } 52 | 53 | // ImageReviewSpec is a description of the pod creation request. 54 | message ImageReviewSpec { 55 | // Containers is a list of a subset of the information in each container of the Pod being created. 56 | // +optional 57 | // +listType=atomic 58 | repeated ImageReviewContainerSpec containers = 1; 59 | 60 | // Annotations is a list of key-value pairs extracted from the Pod's annotations. 61 | // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. 62 | // It is up to each webhook backend to determine how to interpret these annotations, if at all. 63 | // +optional 64 | map annotations = 2; 65 | 66 | // Namespace is the namespace the pod is being created in. 67 | // +optional 68 | optional string namespace = 3; 69 | } 70 | 71 | // ImageReviewStatus is the result of the review for the pod creation request. 72 | message ImageReviewStatus { 73 | // Allowed indicates that all images were allowed to be run. 74 | optional bool allowed = 1; 75 | 76 | // Reason should be empty unless Allowed is false in which case it 77 | // may contain a short description of what is wrong. Kubernetes 78 | // may truncate excessively long errors when displaying to the user. 79 | // +optional 80 | optional string reason = 2; 81 | 82 | // AuditAnnotations will be added to the attributes object of the 83 | // admission controller request using 'AddAnnotation'. The keys should 84 | // be prefix-less (i.e., the admission controller will add an 85 | // appropriate prefix). 86 | // +optional 87 | map auditAnnotations = 3; 88 | } 89 | 90 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/networking/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.networking.v1alpha1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/generated.proto"; 26 | import "apimachinery/pkg/runtime/schema/generated.proto"; 27 | 28 | // Package-wide variables from generator "generated". 29 | option go_package = "k8s.io/api/networking/v1alpha1"; 30 | 31 | // IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs 32 | // that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. 33 | // An IP address can be represented in different formats, to guarantee the uniqueness of the IP, 34 | // the name of the object is the IP address in canonical format, four decimal digits separated 35 | // by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. 36 | // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 37 | // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 38 | message IPAddress { 39 | // Standard object's metadata. 40 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 41 | // +optional 42 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 43 | 44 | // spec is the desired state of the IPAddress. 45 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 46 | // +optional 47 | optional IPAddressSpec spec = 2; 48 | } 49 | 50 | // IPAddressList contains a list of IPAddress. 51 | message IPAddressList { 52 | // Standard object's metadata. 53 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 54 | // +optional 55 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 56 | 57 | // items is the list of IPAddresses. 58 | repeated IPAddress items = 2; 59 | } 60 | 61 | // IPAddressSpec describe the attributes in an IP Address. 62 | message IPAddressSpec { 63 | // ParentRef references the resource that an IPAddress is attached to. 64 | // An IPAddress must reference a parent object. 65 | // +required 66 | optional ParentReference parentRef = 1; 67 | } 68 | 69 | // ParentReference describes a reference to a parent object. 70 | message ParentReference { 71 | // Group is the group of the object being referenced. 72 | // +optional 73 | optional string group = 1; 74 | 75 | // Resource is the resource of the object being referenced. 76 | // +required 77 | optional string resource = 2; 78 | 79 | // Namespace is the namespace of the object being referenced. 80 | // +optional 81 | optional string namespace = 3; 82 | 83 | // Name is the name of the object being referenced. 84 | // +required 85 | optional string name = 4; 86 | } 87 | 88 | // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). 89 | // This range is used to allocate ClusterIPs to Service objects. 90 | message ServiceCIDR { 91 | // Standard object's metadata. 92 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 93 | // +optional 94 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 95 | 96 | // spec is the desired state of the ServiceCIDR. 97 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 98 | // +optional 99 | optional ServiceCIDRSpec spec = 2; 100 | 101 | // status represents the current state of the ServiceCIDR. 102 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 103 | // +optional 104 | optional ServiceCIDRStatus status = 3; 105 | } 106 | 107 | // ServiceCIDRList contains a list of ServiceCIDR objects. 108 | message ServiceCIDRList { 109 | // Standard object's metadata. 110 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 111 | // +optional 112 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 113 | 114 | // items is the list of ServiceCIDRs. 115 | repeated ServiceCIDR items = 2; 116 | } 117 | 118 | // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. 119 | message ServiceCIDRSpec { 120 | // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") 121 | // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. 122 | // The network address of each CIDR, the address that identifies the subnet of a host, is reserved 123 | // and will not be allocated. The broadcast address for IPv4 CIDRs is also reserved and will not be 124 | // allocated. 125 | // This field is immutable. 126 | // +optional 127 | // +listType=atomic 128 | repeated string cidrs = 1; 129 | } 130 | 131 | // ServiceCIDRStatus describes the current state of the ServiceCIDR. 132 | message ServiceCIDRStatus { 133 | // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. 134 | // Current service state 135 | // +optional 136 | // +patchMergeKey=type 137 | // +patchStrategy=merge 138 | // +listType=map 139 | // +listMapKey=type 140 | repeated .apimachinery.pkg.apis.meta.v1.Condition conditions = 1; 141 | } 142 | 143 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/node/v1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.node.v1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/api/node/v1"; 32 | 33 | // Overhead structure represents the resource overhead associated with running a pod. 34 | message Overhead { 35 | // podFixed represents the fixed resource overhead associated with running a pod. 36 | // +optional 37 | map podFixed = 1; 38 | } 39 | 40 | // RuntimeClass defines a class of container runtime supported in the cluster. 41 | // The RuntimeClass is used to determine which container runtime is used to run 42 | // all containers in a pod. RuntimeClasses are manually defined by a 43 | // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 44 | // responsible for resolving the RuntimeClassName reference before running the 45 | // pod. For more details, see 46 | // https://kubernetes.io/docs/concepts/containers/runtime-class/ 47 | message RuntimeClass { 48 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 49 | // +optional 50 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 51 | 52 | // handler specifies the underlying runtime and configuration that the CRI 53 | // implementation will use to handle pods of this class. The possible values 54 | // are specific to the node & CRI configuration. It is assumed that all 55 | // handlers are available on every node, and handlers of the same name are 56 | // equivalent on every node. 57 | // For example, a handler called "runc" might specify that the runc OCI 58 | // runtime (using native Linux containers) will be used to run the containers 59 | // in a pod. 60 | // The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, 61 | // and is immutable. 62 | optional string handler = 2; 63 | 64 | // overhead represents the resource overhead associated with running a pod for a 65 | // given RuntimeClass. For more details, see 66 | // https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/ 67 | // +optional 68 | optional Overhead overhead = 3; 69 | 70 | // scheduling holds the scheduling constraints to ensure that pods running 71 | // with this RuntimeClass are scheduled to nodes that support it. 72 | // If scheduling is nil, this RuntimeClass is assumed to be supported by all 73 | // nodes. 74 | // +optional 75 | optional Scheduling scheduling = 4; 76 | } 77 | 78 | // RuntimeClassList is a list of RuntimeClass objects. 79 | message RuntimeClassList { 80 | // Standard list metadata. 81 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 82 | // +optional 83 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 84 | 85 | // items is a list of schema objects. 86 | repeated RuntimeClass items = 2; 87 | } 88 | 89 | // Scheduling specifies the scheduling constraints for nodes supporting a 90 | // RuntimeClass. 91 | message Scheduling { 92 | // nodeSelector lists labels that must be present on nodes that support this 93 | // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 94 | // node matched by this selector. The RuntimeClass nodeSelector is merged 95 | // with a pod's existing nodeSelector. Any conflicts will cause the pod to 96 | // be rejected in admission. 97 | // +optional 98 | // +mapType=atomic 99 | map nodeSelector = 1; 100 | 101 | // tolerations are appended (excluding duplicates) to pods running with this 102 | // RuntimeClass during admission, effectively unioning the set of nodes 103 | // tolerated by the pod and the RuntimeClass. 104 | // +optional 105 | // +listType=atomic 106 | repeated .api.core.v1.Toleration tolerations = 2; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/node/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.node.v1alpha1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/api/node/v1alpha1"; 32 | 33 | // Overhead structure represents the resource overhead associated with running a pod. 34 | message Overhead { 35 | // podFixed represents the fixed resource overhead associated with running a pod. 36 | // +optional 37 | map podFixed = 1; 38 | } 39 | 40 | // RuntimeClass defines a class of container runtime supported in the cluster. 41 | // The RuntimeClass is used to determine which container runtime is used to run 42 | // all containers in a pod. RuntimeClasses are (currently) manually defined by a 43 | // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 44 | // responsible for resolving the RuntimeClassName reference before running the 45 | // pod. For more details, see 46 | // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class 47 | message RuntimeClass { 48 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 49 | // +optional 50 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 51 | 52 | // spec represents specification of the RuntimeClass 53 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 54 | optional RuntimeClassSpec spec = 2; 55 | } 56 | 57 | // RuntimeClassList is a list of RuntimeClass objects. 58 | message RuntimeClassList { 59 | // Standard list metadata. 60 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 61 | // +optional 62 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 63 | 64 | // items is a list of schema objects. 65 | repeated RuntimeClass items = 2; 66 | } 67 | 68 | // RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters 69 | // that are required to describe the RuntimeClass to the Container Runtime 70 | // Interface (CRI) implementation, as well as any other components that need to 71 | // understand how the pod will be run. The RuntimeClassSpec is immutable. 72 | message RuntimeClassSpec { 73 | // runtimeHandler specifies the underlying runtime and configuration that the 74 | // CRI implementation will use to handle pods of this class. The possible 75 | // values are specific to the node & CRI configuration. It is assumed that 76 | // all handlers are available on every node, and handlers of the same name are 77 | // equivalent on every node. 78 | // For example, a handler called "runc" might specify that the runc OCI 79 | // runtime (using native Linux containers) will be used to run the containers 80 | // in a pod. 81 | // The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123) 82 | // requirements, and is immutable. 83 | optional string runtimeHandler = 1; 84 | 85 | // overhead represents the resource overhead associated with running a pod for a 86 | // given RuntimeClass. For more details, see 87 | // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md 88 | // +optional 89 | optional Overhead overhead = 2; 90 | 91 | // scheduling holds the scheduling constraints to ensure that pods running 92 | // with this RuntimeClass are scheduled to nodes that support it. 93 | // If scheduling is nil, this RuntimeClass is assumed to be supported by all 94 | // nodes. 95 | // +optional 96 | optional Scheduling scheduling = 3; 97 | } 98 | 99 | // Scheduling specifies the scheduling constraints for nodes supporting a 100 | // RuntimeClass. 101 | message Scheduling { 102 | // nodeSelector lists labels that must be present on nodes that support this 103 | // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 104 | // node matched by this selector. The RuntimeClass nodeSelector is merged 105 | // with a pod's existing nodeSelector. Any conflicts will cause the pod to 106 | // be rejected in admission. 107 | // +optional 108 | // +mapType=atomic 109 | map nodeSelector = 1; 110 | 111 | // tolerations are appended (excluding duplicates) to pods running with this 112 | // RuntimeClass during admission, effectively unioning the set of nodes 113 | // tolerated by the pod and the RuntimeClass. 114 | // +optional 115 | // +listType=atomic 116 | repeated .api.core.v1.Toleration tolerations = 2; 117 | } 118 | 119 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/node/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.node.v1beta1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/api/node/v1beta1"; 32 | 33 | // Overhead structure represents the resource overhead associated with running a pod. 34 | message Overhead { 35 | // podFixed represents the fixed resource overhead associated with running a pod. 36 | // +optional 37 | map podFixed = 1; 38 | } 39 | 40 | // RuntimeClass defines a class of container runtime supported in the cluster. 41 | // The RuntimeClass is used to determine which container runtime is used to run 42 | // all containers in a pod. RuntimeClasses are (currently) manually defined by a 43 | // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 44 | // responsible for resolving the RuntimeClassName reference before running the 45 | // pod. For more details, see 46 | // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class 47 | message RuntimeClass { 48 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 49 | // +optional 50 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 51 | 52 | // handler specifies the underlying runtime and configuration that the CRI 53 | // implementation will use to handle pods of this class. The possible values 54 | // are specific to the node & CRI configuration. It is assumed that all 55 | // handlers are available on every node, and handlers of the same name are 56 | // equivalent on every node. 57 | // For example, a handler called "runc" might specify that the runc OCI 58 | // runtime (using native Linux containers) will be used to run the containers 59 | // in a pod. 60 | // The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, 61 | // and is immutable. 62 | optional string handler = 2; 63 | 64 | // overhead represents the resource overhead associated with running a pod for a 65 | // given RuntimeClass. For more details, see 66 | // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md 67 | // +optional 68 | optional Overhead overhead = 3; 69 | 70 | // scheduling holds the scheduling constraints to ensure that pods running 71 | // with this RuntimeClass are scheduled to nodes that support it. 72 | // If scheduling is nil, this RuntimeClass is assumed to be supported by all 73 | // nodes. 74 | // +optional 75 | optional Scheduling scheduling = 4; 76 | } 77 | 78 | // RuntimeClassList is a list of RuntimeClass objects. 79 | message RuntimeClassList { 80 | // Standard list metadata. 81 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 82 | // +optional 83 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 84 | 85 | // items is a list of schema objects. 86 | repeated RuntimeClass items = 2; 87 | } 88 | 89 | // Scheduling specifies the scheduling constraints for nodes supporting a 90 | // RuntimeClass. 91 | message Scheduling { 92 | // nodeSelector lists labels that must be present on nodes that support this 93 | // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 94 | // node matched by this selector. The RuntimeClass nodeSelector is merged 95 | // with a pod's existing nodeSelector. Any conflicts will cause the pod to 96 | // be rejected in admission. 97 | // +optional 98 | // +mapType=atomic 99 | map nodeSelector = 1; 100 | 101 | // tolerations are appended (excluding duplicates) to pods running with this 102 | // RuntimeClass during admission, effectively unioning the set of nodes 103 | // tolerated by the pod and the RuntimeClass. 104 | // +optional 105 | // +listType=atomic 106 | repeated .api.core.v1.Toleration tolerations = 2; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/scheduling/v1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.scheduling.v1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/scheduling/v1"; 31 | 32 | // PriorityClass defines mapping from a priority class name to the priority 33 | // integer value. The value can be any valid integer. 34 | message PriorityClass { 35 | // Standard object's metadata. 36 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 37 | // +optional 38 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 39 | 40 | // value represents the integer value of this priority class. This is the actual priority that pods 41 | // receive when they have the name of this class in their pod spec. 42 | optional int32 value = 2; 43 | 44 | // globalDefault specifies whether this PriorityClass should be considered as 45 | // the default priority for pods that do not have any priority class. 46 | // Only one PriorityClass can be marked as `globalDefault`. However, if more than 47 | // one PriorityClasses exists with their `globalDefault` field set to true, 48 | // the smallest value of such global default PriorityClasses will be used as the default priority. 49 | // +optional 50 | optional bool globalDefault = 3; 51 | 52 | // description is an arbitrary string that usually provides guidelines on 53 | // when this priority class should be used. 54 | // +optional 55 | optional string description = 4; 56 | 57 | // preemptionPolicy is the Policy for preempting pods with lower priority. 58 | // One of Never, PreemptLowerPriority. 59 | // Defaults to PreemptLowerPriority if unset. 60 | // +optional 61 | optional string preemptionPolicy = 5; 62 | } 63 | 64 | // PriorityClassList is a collection of priority classes. 65 | message PriorityClassList { 66 | // Standard list metadata 67 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 68 | // +optional 69 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 70 | 71 | // items is the list of PriorityClasses 72 | repeated PriorityClass items = 2; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/scheduling/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.scheduling.v1alpha1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/scheduling/v1alpha1"; 31 | 32 | // DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. 33 | // PriorityClass defines mapping from a priority class name to the priority 34 | // integer value. The value can be any valid integer. 35 | message PriorityClass { 36 | // Standard object's metadata. 37 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 38 | // +optional 39 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 40 | 41 | // value represents the integer value of this priority class. This is the actual priority that pods 42 | // receive when they have the name of this class in their pod spec. 43 | optional int32 value = 2; 44 | 45 | // globalDefault specifies whether this PriorityClass should be considered as 46 | // the default priority for pods that do not have any priority class. 47 | // Only one PriorityClass can be marked as `globalDefault`. However, if more than 48 | // one PriorityClasses exists with their `globalDefault` field set to true, 49 | // the smallest value of such global default PriorityClasses will be used as the default priority. 50 | // +optional 51 | optional bool globalDefault = 3; 52 | 53 | // description is an arbitrary string that usually provides guidelines on 54 | // when this priority class should be used. 55 | // +optional 56 | optional string description = 4; 57 | 58 | // preemptionPolicy is the Policy for preempting pods with lower priority. 59 | // One of Never, PreemptLowerPriority. 60 | // Defaults to PreemptLowerPriority if unset. 61 | // +optional 62 | optional string preemptionPolicy = 5; 63 | } 64 | 65 | // PriorityClassList is a collection of priority classes. 66 | message PriorityClassList { 67 | // Standard list metadata 68 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 69 | // +optional 70 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 71 | 72 | // items is the list of PriorityClasses 73 | repeated PriorityClass items = 2; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/scheduling/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.scheduling.v1beta1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/scheduling/v1beta1"; 31 | 32 | // DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. 33 | // PriorityClass defines mapping from a priority class name to the priority 34 | // integer value. The value can be any valid integer. 35 | message PriorityClass { 36 | // Standard object's metadata. 37 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 38 | // +optional 39 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 40 | 41 | // value represents the integer value of this priority class. This is the actual priority that pods 42 | // receive when they have the name of this class in their pod spec. 43 | optional int32 value = 2; 44 | 45 | // globalDefault specifies whether this PriorityClass should be considered as 46 | // the default priority for pods that do not have any priority class. 47 | // Only one PriorityClass can be marked as `globalDefault`. However, if more than 48 | // one PriorityClasses exists with their `globalDefault` field set to true, 49 | // the smallest value of such global default PriorityClasses will be used as the default priority. 50 | // +optional 51 | optional bool globalDefault = 3; 52 | 53 | // description is an arbitrary string that usually provides guidelines on 54 | // when this priority class should be used. 55 | // +optional 56 | optional string description = 4; 57 | 58 | // preemptionPolicy is the Policy for preempting pods with lower priority. 59 | // One of Never, PreemptLowerPriority. 60 | // Defaults to PreemptLowerPriority if unset. 61 | // +optional 62 | optional string preemptionPolicy = 5; 63 | } 64 | 65 | // PriorityClassList is a collection of priority classes. 66 | message PriorityClassList { 67 | // Standard list metadata 68 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 69 | // +optional 70 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 71 | 72 | // items is the list of PriorityClasses 73 | repeated PriorityClass items = 2; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/api/storagemigration/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package api.storagemigration.v1alpha1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/api/storagemigration/v1alpha1"; 31 | 32 | // The names of the group, the version, and the resource. 33 | message GroupVersionResource { 34 | // The name of the group. 35 | optional string group = 1; 36 | 37 | // The name of the version. 38 | optional string version = 2; 39 | 40 | // The name of the resource. 41 | optional string resource = 3; 42 | } 43 | 44 | // Describes the state of a migration at a certain point. 45 | message MigrationCondition { 46 | // Type of the condition. 47 | optional string type = 1; 48 | 49 | // Status of the condition, one of True, False, Unknown. 50 | optional string status = 2; 51 | 52 | // The last time this condition was updated. 53 | // +optional 54 | optional .apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 3; 55 | 56 | // The reason for the condition's last transition. 57 | // +optional 58 | optional string reason = 4; 59 | 60 | // A human readable message indicating details about the transition. 61 | // +optional 62 | optional string message = 5; 63 | } 64 | 65 | // StorageVersionMigration represents a migration of stored data to the latest 66 | // storage version. 67 | message StorageVersionMigration { 68 | // Standard object metadata. 69 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 70 | // +optional 71 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 72 | 73 | // Specification of the migration. 74 | // +optional 75 | optional StorageVersionMigrationSpec spec = 2; 76 | 77 | // Status of the migration. 78 | // +optional 79 | optional StorageVersionMigrationStatus status = 3; 80 | } 81 | 82 | // StorageVersionMigrationList is a collection of storage version migrations. 83 | message StorageVersionMigrationList { 84 | // Standard list metadata 85 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 86 | // +optional 87 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 88 | 89 | // Items is the list of StorageVersionMigration 90 | // +patchMergeKey=type 91 | // +patchStrategy=merge 92 | // +listType=map 93 | // +listMapKey=type 94 | repeated StorageVersionMigration items = 2; 95 | } 96 | 97 | // Spec of the storage version migration. 98 | message StorageVersionMigrationSpec { 99 | // The resource that is being migrated. The migrator sends requests to 100 | // the endpoint serving the resource. 101 | // Immutable. 102 | optional GroupVersionResource resource = 1; 103 | 104 | // The token used in the list options to get the next chunk of objects 105 | // to migrate. When the .status.conditions indicates the migration is 106 | // "Running", users can use this token to check the progress of the 107 | // migration. 108 | // +optional 109 | optional string continueToken = 2; 110 | } 111 | 112 | // Status of the storage version migration. 113 | message StorageVersionMigrationStatus { 114 | // The latest available observations of the migration's current state. 115 | // +patchMergeKey=type 116 | // +patchStrategy=merge 117 | // +listType=map 118 | // +listMapKey=type 119 | // +optional 120 | repeated MigrationCondition conditions = 1; 121 | 122 | // ResourceVersion to compare with the GC cache for performing the migration. 123 | // This is the current resource version of given group, version and resource when 124 | // kube-controller-manager first observes this StorageVersionMigration resource. 125 | optional string resourceVersion = 2; 126 | } 127 | 128 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/apimachinery/pkg/api/resource/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package apimachinery.pkg.api.resource; 23 | 24 | // Package-wide variables from generator "generated". 25 | option go_package = "k8s.io/apimachinery/pkg/api/resource"; 26 | 27 | // Quantity is a fixed-point representation of a number. 28 | // It provides convenient marshaling/unmarshaling in JSON and YAML, 29 | // in addition to String() and AsInt64() accessors. 30 | // 31 | // The serialization format is: 32 | // 33 | // ``` 34 | // ::= 35 | // 36 | // (Note that may be empty, from the "" case in .) 37 | // 38 | // ::= 0 | 1 | ... | 9 39 | // ::= | 40 | // ::= | . | . | . 41 | // ::= "+" | "-" 42 | // ::= | 43 | // ::= | | 44 | // ::= Ki | Mi | Gi | Ti | Pi | Ei 45 | // 46 | // (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html) 47 | // 48 | // ::= m | "" | k | M | G | T | P | E 49 | // 50 | // (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.) 51 | // 52 | // ::= "e" | "E" 53 | // ``` 54 | // 55 | // No matter which of the three exponent forms is used, no quantity may represent 56 | // a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal 57 | // places. Numbers larger or more precise will be capped or rounded up. 58 | // (E.g.: 0.1m will rounded up to 1m.) 59 | // This may be extended in the future if we require larger or smaller quantities. 60 | // 61 | // When a Quantity is parsed from a string, it will remember the type of suffix 62 | // it had, and will use the same type again when it is serialized. 63 | // 64 | // Before serializing, Quantity will be put in "canonical form". 65 | // This means that Exponent/suffix will be adjusted up or down (with a 66 | // corresponding increase or decrease in Mantissa) such that: 67 | // 68 | // - No precision is lost 69 | // - No fractional digits will be emitted 70 | // - The exponent (or suffix) is as large as possible. 71 | // 72 | // The sign will be omitted unless the number is negative. 73 | // 74 | // Examples: 75 | // 76 | // - 1.5 will be serialized as "1500m" 77 | // - 1.5Gi will be serialized as "1536Mi" 78 | // 79 | // Note that the quantity will NEVER be internally represented by a 80 | // floating point number. That is the whole point of this exercise. 81 | // 82 | // Non-canonical values will still parse as long as they are well formed, 83 | // but will be re-emitted in their canonical form. (So always use canonical 84 | // form, or don't diff.) 85 | // 86 | // This format is intended to make it difficult to use these numbers without 87 | // writing some sort of special handling code in the hopes that that will 88 | // cause implementors to also use a fixed point implementation. 89 | // 90 | // +protobuf=true 91 | // +protobuf.embed=string 92 | // +protobuf.options.marshal=false 93 | // +protobuf.options.(gogoproto.goproto_stringer)=false 94 | // +k8s:deepcopy-gen=true 95 | // +k8s:openapi-gen=true 96 | message Quantity { 97 | optional string string = 1; 98 | } 99 | 100 | // QuantityValue makes it possible to use a Quantity as value for a command 101 | // line parameter. 102 | // 103 | // +protobuf=true 104 | // +protobuf.embed=string 105 | // +protobuf.options.marshal=false 106 | // +protobuf.options.(gogoproto.goproto_stringer)=false 107 | // +k8s:deepcopy-gen=true 108 | message QuantityValue { 109 | optional string string = 1; 110 | } 111 | 112 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/apimachinery/pkg/apis/meta/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package apimachinery.pkg.apis.meta.v1beta1; 23 | 24 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 25 | import "apimachinery/pkg/runtime/schema/generated.proto"; 26 | 27 | // Package-wide variables from generator "generated". 28 | option go_package = "k8s.io/apimachinery/pkg/apis/meta/v1beta1"; 29 | 30 | // PartialObjectMetadataList contains a list of objects containing only their metadata. 31 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 32 | message PartialObjectMetadataList { 33 | // Standard list metadata. 34 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 35 | // +optional 36 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 2; 37 | 38 | // items contains each of the included items. 39 | repeated .apimachinery.pkg.apis.meta.v1.PartialObjectMetadata items = 1; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/apimachinery/pkg/runtime/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package apimachinery.pkg.runtime; 23 | 24 | // Package-wide variables from generator "generated". 25 | option go_package = "k8s.io/apimachinery/pkg/runtime"; 26 | 27 | // RawExtension is used to hold extensions in external versions. 28 | // 29 | // To use this, make a field which has RawExtension as its type in your external, versioned 30 | // struct, and Object in your internal struct. You also need to register your 31 | // various plugin types. 32 | // 33 | // // Internal package: 34 | // 35 | // type MyAPIObject struct { 36 | // runtime.TypeMeta `json:",inline"` 37 | // MyPlugin runtime.Object `json:"myPlugin"` 38 | // } 39 | // 40 | // type PluginA struct { 41 | // AOption string `json:"aOption"` 42 | // } 43 | // 44 | // // External package: 45 | // 46 | // type MyAPIObject struct { 47 | // runtime.TypeMeta `json:",inline"` 48 | // MyPlugin runtime.RawExtension `json:"myPlugin"` 49 | // } 50 | // 51 | // type PluginA struct { 52 | // AOption string `json:"aOption"` 53 | // } 54 | // 55 | // // On the wire, the JSON will look something like this: 56 | // 57 | // { 58 | // "kind":"MyAPIObject", 59 | // "apiVersion":"v1", 60 | // "myPlugin": { 61 | // "kind":"PluginA", 62 | // "aOption":"foo", 63 | // }, 64 | // } 65 | // 66 | // So what happens? Decode first uses json or yaml to unmarshal the serialized data into 67 | // your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. 68 | // The next step is to copy (using pkg/conversion) into the internal struct. The runtime 69 | // package's DefaultScheme has conversion functions installed which will unpack the 70 | // JSON stored in RawExtension, turning it into the correct object type, and storing it 71 | // in the Object. (TODO: In the case where the object is of an unknown type, a 72 | // runtime.Unknown object will be created and stored.) 73 | // 74 | // +k8s:deepcopy-gen=true 75 | // +protobuf=true 76 | // +k8s:openapi-gen=true 77 | message RawExtension { 78 | // Raw is the underlying serialization of this object. 79 | // 80 | // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data. 81 | optional bytes raw = 1; 82 | } 83 | 84 | // TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, 85 | // like this: 86 | // 87 | // type MyAwesomeAPIObject struct { 88 | // runtime.TypeMeta `json:",inline"` 89 | // ... // other fields 90 | // } 91 | // 92 | // func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind 93 | // 94 | // TypeMeta is provided here for convenience. You may use it directly from this package or define 95 | // your own with the same fields. 96 | // 97 | // +k8s:deepcopy-gen=false 98 | // +protobuf=true 99 | // +k8s:openapi-gen=true 100 | message TypeMeta { 101 | // +optional 102 | optional string apiVersion = 1; 103 | 104 | // +optional 105 | optional string kind = 2; 106 | } 107 | 108 | // Unknown allows api objects with unknown types to be passed-through. This can be used 109 | // to deal with the API objects from a plug-in. Unknown objects still have functioning 110 | // TypeMeta features-- kind, version, etc. 111 | // TODO: Make this object have easy access to field based accessors and settors for 112 | // metadata and field mutatation. 113 | // 114 | // +k8s:deepcopy-gen=true 115 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 116 | // +protobuf=true 117 | // +k8s:openapi-gen=true 118 | message Unknown { 119 | optional TypeMeta typeMeta = 1; 120 | 121 | // Raw will hold the complete serialized object which couldn't be matched 122 | // with a registered type. Most likely, nothing should be done with this 123 | // except for passing it through the system. 124 | optional bytes raw = 2; 125 | 126 | // ContentEncoding is encoding used to encode 'Raw' data. 127 | // Unspecified means no encoding. 128 | optional string contentEncoding = 3; 129 | 130 | // ContentType is serialization method used to serialize 'Raw'. 131 | // Unspecified means ContentTypeJSON. 132 | optional string contentType = 4; 133 | } 134 | 135 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/apimachinery/pkg/runtime/schema/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package apimachinery.pkg.runtime.schema; 23 | 24 | // Package-wide variables from generator "generated". 25 | option go_package = "k8s.io/apimachinery/pkg/runtime/schema"; 26 | 27 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/apimachinery/pkg/util/intstr/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package apimachinery.pkg.util.intstr; 23 | 24 | // Package-wide variables from generator "generated". 25 | option go_package = "k8s.io/apimachinery/pkg/util/intstr"; 26 | 27 | // IntOrString is a type that can hold an int32 or a string. When used in 28 | // JSON or YAML marshalling and unmarshalling, it produces or consumes the 29 | // inner type. This allows you to have, for example, a JSON field that can 30 | // accept a name or number. 31 | // TODO: Rename to Int32OrString 32 | // 33 | // +protobuf=true 34 | // +protobuf.options.(gogoproto.goproto_stringer)=false 35 | // +k8s:openapi-gen=true 36 | message IntOrString { 37 | optional int64 type = 1; 38 | 39 | optional int32 intVal = 2; 40 | 41 | optional string strVal = 3; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package metrics.pkg.apis.custom_metrics.v1beta1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"; 32 | 33 | // MetricListOptions is used to select metrics by their label selectors 34 | message MetricListOptions { 35 | // A selector to restrict the list of returned objects by their labels. 36 | // Defaults to everything. 37 | // +optional 38 | optional string labelSelector = 1; 39 | 40 | // A selector to restrict the list of returned metrics by their labels 41 | // +optional 42 | optional string metricLabelSelector = 2; 43 | } 44 | 45 | // MetricValue is a metric value for some object 46 | message MetricValue { 47 | // a reference to the described object 48 | optional .api.core.v1.ObjectReference describedObject = 1; 49 | 50 | // the name of the metric 51 | optional string metricName = 2; 52 | 53 | // indicates the time at which the metrics were produced 54 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 3; 55 | 56 | // indicates the window ([Timestamp-Window, Timestamp]) from 57 | // which these metrics were calculated, when returning rate 58 | // metrics calculated from cumulative metrics (or zero for 59 | // non-calculated instantaneous metrics). 60 | optional int64 window = 4; 61 | 62 | // the value of the metric for this 63 | optional .apimachinery.pkg.api.resource.Quantity value = 5; 64 | 65 | // selector represents the label selector that could be used to select 66 | // this metric, and will generally just be the selector passed in to 67 | // the query used to fetch this metric. 68 | // When left blank, only the metric's Name will be used to gather metrics. 69 | // +optional 70 | optional .apimachinery.pkg.apis.meta.v1.LabelSelector selector = 6; 71 | } 72 | 73 | // MetricValueList is a list of values for a given metric for some set of objects 74 | message MetricValueList { 75 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 76 | 77 | // the value of the metric across the described objects 78 | repeated MetricValue items = 2; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package metrics.pkg.apis.custom_metrics.v1beta2; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"; 32 | 33 | // MetricIdentifier identifies a metric by name and, optionally, selector 34 | message MetricIdentifier { 35 | // name is the name of the given metric 36 | optional string name = 1; 37 | 38 | // selector represents the label selector that could be used to select 39 | // this metric, and will generally just be the selector passed in to 40 | // the query used to fetch this metric. 41 | // When left blank, only the metric's Name will be used to gather metrics. 42 | // +optional 43 | optional .apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; 44 | } 45 | 46 | // MetricListOptions is used to select metrics by their label selectors 47 | message MetricListOptions { 48 | // A selector to restrict the list of returned objects by their labels. 49 | // Defaults to everything. 50 | // +optional 51 | optional string labelSelector = 1; 52 | 53 | // A selector to restrict the list of returned metrics by their labels 54 | // +optional 55 | optional string metricLabelSelector = 2; 56 | } 57 | 58 | // MetricValue is the metric value for some object 59 | message MetricValue { 60 | // a reference to the described object 61 | optional .api.core.v1.ObjectReference describedObject = 1; 62 | 63 | optional MetricIdentifier metric = 2; 64 | 65 | // indicates the time at which the metrics were produced 66 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 3; 67 | 68 | // indicates the window ([Timestamp-Window, Timestamp]) from 69 | // which these metrics were calculated, when returning rate 70 | // metrics calculated from cumulative metrics (or zero for 71 | // non-calculated instantaneous metrics). 72 | optional int64 windowSeconds = 4; 73 | 74 | // the value of the metric for this 75 | optional .apimachinery.pkg.api.resource.Quantity value = 5; 76 | } 77 | 78 | // MetricValueList is a list of values for a given metric for some set of objects 79 | message MetricValueList { 80 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 81 | 82 | // the value of the metric across the described objects 83 | repeated MetricValue items = 2; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/metrics/pkg/apis/external_metrics/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package metrics.pkg.apis.external_metrics.v1beta1; 23 | 24 | import "apimachinery/pkg/api/resource/generated.proto"; 25 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 26 | import "apimachinery/pkg/runtime/generated.proto"; 27 | import "apimachinery/pkg/runtime/schema/generated.proto"; 28 | 29 | // Package-wide variables from generator "generated". 30 | option go_package = "k8s.io/metrics/pkg/apis/external_metrics/v1beta1"; 31 | 32 | // ExternalMetricValue is a metric value for external metric 33 | // A single metric value is identified by metric name and a set of string labels. 34 | // For one metric there can be multiple values with different sets of labels. 35 | message ExternalMetricValue { 36 | // the name of the metric 37 | optional string metricName = 1; 38 | 39 | // a set of labels that identify a single time series for the metric 40 | map metricLabels = 2; 41 | 42 | // indicates the time at which the metrics were produced 43 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 3; 44 | 45 | // indicates the window ([Timestamp-Window, Timestamp]) from 46 | // which these metrics were calculated, when returning rate 47 | // metrics calculated from cumulative metrics (or zero for 48 | // non-calculated instantaneous metrics). 49 | optional int64 window = 4; 50 | 51 | // the value of the metric 52 | optional .apimachinery.pkg.api.resource.Quantity value = 5; 53 | } 54 | 55 | // ExternalMetricValueList is a list of values for a given metric for some set labels 56 | message ExternalMetricValueList { 57 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 58 | 59 | // value of the metric matching a given set of labels 60 | repeated ExternalMetricValue items = 2; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/metrics/pkg/apis/metrics/v1alpha1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package metrics.pkg.apis.metrics.v1alpha1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/metrics/pkg/apis/metrics/v1alpha1"; 32 | 33 | // ContainerMetrics sets resource usage metrics of a container. 34 | message ContainerMetrics { 35 | // Container name corresponding to the one from pod.spec.containers. 36 | optional string name = 1; 37 | 38 | // The memory usage is the memory working set. 39 | map usage = 2; 40 | } 41 | 42 | // NodeMetrics sets resource usage metrics of a node. 43 | message NodeMetrics { 44 | // Standard object's metadata. 45 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 46 | // +optional 47 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 48 | 49 | // The following fields define time interval from which metrics were 50 | // collected from the interval [Timestamp-Window, Timestamp]. 51 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 2; 52 | 53 | optional .apimachinery.pkg.apis.meta.v1.Duration window = 3; 54 | 55 | // The memory usage is the memory working set. 56 | map usage = 4; 57 | } 58 | 59 | // NodeMetricsList is a list of NodeMetrics. 60 | message NodeMetricsList { 61 | // Standard list metadata. 62 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 63 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 64 | 65 | // List of node metrics. 66 | repeated NodeMetrics items = 2; 67 | } 68 | 69 | // PodMetrics sets resource usage metrics of a pod. 70 | message PodMetrics { 71 | // Standard object's metadata. 72 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 73 | // +optional 74 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 75 | 76 | // The following fields define time interval from which metrics were 77 | // collected from the interval [Timestamp-Window, Timestamp]. 78 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 2; 79 | 80 | optional .apimachinery.pkg.apis.meta.v1.Duration window = 3; 81 | 82 | // Metrics for all containers are collected within the same time window. 83 | // +listType=atomic 84 | repeated ContainerMetrics containers = 4; 85 | } 86 | 87 | // PodMetricsList is a list of PodMetrics. 88 | message PodMetricsList { 89 | // Standard list metadata. 90 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 91 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 92 | 93 | // List of pod metrics. 94 | repeated PodMetrics items = 2; 95 | } 96 | 97 | -------------------------------------------------------------------------------- /k8s-pb-codegen/protos/metrics/pkg/apis/metrics/v1beta1/generated.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | 18 | // This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 | 20 | syntax = "proto2"; 21 | 22 | package metrics.pkg.apis.metrics.v1beta1; 23 | 24 | import "api/core/v1/generated.proto"; 25 | import "apimachinery/pkg/api/resource/generated.proto"; 26 | import "apimachinery/pkg/apis/meta/v1/generated.proto"; 27 | import "apimachinery/pkg/runtime/generated.proto"; 28 | import "apimachinery/pkg/runtime/schema/generated.proto"; 29 | 30 | // Package-wide variables from generator "generated". 31 | option go_package = "k8s.io/metrics/pkg/apis/metrics/v1beta1"; 32 | 33 | // ContainerMetrics sets resource usage metrics of a container. 34 | message ContainerMetrics { 35 | // Container name corresponding to the one from pod.spec.containers. 36 | optional string name = 1; 37 | 38 | // The memory usage is the memory working set. 39 | map usage = 2; 40 | } 41 | 42 | // NodeMetrics sets resource usage metrics of a node. 43 | message NodeMetrics { 44 | // Standard object's metadata. 45 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 46 | // +optional 47 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 48 | 49 | // The following fields define time interval from which metrics were 50 | // collected from the interval [Timestamp-Window, Timestamp]. 51 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 2; 52 | 53 | optional .apimachinery.pkg.apis.meta.v1.Duration window = 3; 54 | 55 | // The memory usage is the memory working set. 56 | map usage = 4; 57 | } 58 | 59 | // NodeMetricsList is a list of NodeMetrics. 60 | message NodeMetricsList { 61 | // Standard list metadata. 62 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 63 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 64 | 65 | // List of node metrics. 66 | repeated NodeMetrics items = 2; 67 | } 68 | 69 | // PodMetrics sets resource usage metrics of a pod. 70 | message PodMetrics { 71 | // Standard object's metadata. 72 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 73 | // +optional 74 | optional .apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 75 | 76 | // The following fields define time interval from which metrics were 77 | // collected from the interval [Timestamp-Window, Timestamp]. 78 | optional .apimachinery.pkg.apis.meta.v1.Time timestamp = 2; 79 | 80 | optional .apimachinery.pkg.apis.meta.v1.Duration window = 3; 81 | 82 | // Metrics for all containers are collected within the same time window. 83 | // +listType=atomic 84 | repeated ContainerMetrics containers = 4; 85 | } 86 | 87 | // PodMetricsList is a list of PodMetrics. 88 | message PodMetricsList { 89 | // Standard list metadata. 90 | // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 91 | optional .apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 92 | 93 | // List of pod metrics. 94 | repeated PodMetrics items = 2; 95 | } 96 | 97 | -------------------------------------------------------------------------------- /k8s-pb-codegen/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Debug, serde::Deserialize)] 2 | #[serde(rename_all = "camelCase")] 3 | pub struct Resource { 4 | /// Name of the resource used in URL. 5 | pub name: String, 6 | /// True if the resource is namespaced. May still have `all` verbs like `list`. 7 | pub namespaced: bool, 8 | pub api_version: String, 9 | pub group: String, 10 | pub version: String, 11 | pub kind: String, 12 | /// Protobuf type path. 13 | pub proto: String, 14 | /// Rust type path. 15 | pub rust: String, 16 | /// Metadata type. 17 | pub metadata: Option, 18 | /// Spec type if any. 19 | pub spec: Option, 20 | /// Status type if any. 21 | pub status: Option, 22 | /// Condition type if the resource has `.status.conditions`. 23 | pub condition: Option, 24 | /// Verbs grouped by scope. `all` or `namespaced`. 25 | pub scoped_verbs: ScopedVerbs, 26 | /// All paths associated with this resource. 27 | pub paths: Vec, 28 | // TODO `Option>` 29 | /// Any subresources. 30 | pub subresources: Vec, 31 | } 32 | 33 | #[derive(Clone, Debug, serde::Deserialize)] 34 | #[serde(rename_all = "camelCase")] 35 | pub struct ScopedVerbs { 36 | pub all: Option>, 37 | /// Namespaced actions. 38 | pub namespaced: Option>, 39 | } 40 | 41 | #[derive(Clone, Debug, serde::Deserialize)] 42 | #[serde(rename_all = "camelCase")] 43 | pub struct Subresource { 44 | /// Name of the subresouce used in URL. 45 | pub name: String, 46 | /// Verbs grouped by scope. `all` or `namespaced`. 47 | pub scoped_verbs: ScopedVerbs, 48 | /// All paths associated with this subresource. 49 | pub paths: Vec, 50 | } 51 | -------------------------------------------------------------------------------- /k8s-pb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "k8s-pb" 3 | version = "0.8.0" 4 | authors = [ 5 | "clux ", 6 | "kazk ", 7 | ] 8 | license = "Apache-2.0" 9 | repository = "https://github.com/kube-rs/k8s-pb" 10 | description = "Bindings for the Kubernetes Client API" 11 | readme = "../README.md" 12 | keywords = ["kubernetes", "openapi", "protos"] 13 | categories = ["network-programming", "caching", "api-bindings", "encoding"] 14 | rust-version = "1.65.0" 15 | edition = "2021" 16 | 17 | [dependencies] 18 | prost = { workspace = true } 19 | -------------------------------------------------------------------------------- /k8s-pb/src/api/admission/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/admissionregistration/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/apidiscovery/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v2; 2 | pub mod v2beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/apiserverinternal/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1alpha1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/api/apps/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | pub mod v1beta2; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/authentication/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/authentication/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. 3 | /// When using impersonation, users will receive the user info of the user being impersonated. If impersonation or 4 | /// request header authentication is used, any extra keys will have their case ignored and returned as lowercase. 5 | #[derive(Clone, PartialEq, ::prost::Message)] 6 | pub struct SelfSubjectReview { 7 | /// Standard object's metadata. 8 | /// More info: 9 | /// +optional 10 | #[prost(message, optional, tag = "1")] 11 | pub metadata: ::core::option::Option, 12 | /// Status is filled in by the server with the user attributes. 13 | #[prost(message, optional, tag = "2")] 14 | pub status: ::core::option::Option, 15 | } 16 | /// SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. 17 | #[derive(Clone, PartialEq, ::prost::Message)] 18 | pub struct SelfSubjectReviewStatus { 19 | /// User attributes of the user making this request. 20 | /// +optional 21 | #[prost(message, optional, tag = "1")] 22 | pub user_info: ::core::option::Option, 23 | } 24 | -------------------------------------------------------------------------------- /k8s-pb/src/api/authorization/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/autoscaling/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v2; 3 | pub mod v2beta1; 4 | pub mod v2beta2; 5 | -------------------------------------------------------------------------------- /k8s-pb/src/api/batch/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/certificates/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/certificates/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors 3 | /// (root certificates). 4 | /// 5 | /// ClusterTrustBundle objects are considered to be readable by any authenticated 6 | /// user in the cluster, because they can be mounted by pods using the 7 | /// `clusterTrustBundle` projection. All service accounts have read access to 8 | /// ClusterTrustBundles by default. Users who only have namespace-level access 9 | /// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount 10 | /// that they have access to. 11 | /// 12 | /// It can be optionally associated with a particular assigner, in which case it 13 | /// contains one valid set of trust anchors for that signer. Signers may have 14 | /// multiple associated ClusterTrustBundles; each is an independent set of trust 15 | /// anchors for that signer. Admission control is used to enforce that only users 16 | /// with permissions on the signer can create or modify the corresponding bundle. 17 | #[derive(Clone, PartialEq, ::prost::Message)] 18 | pub struct ClusterTrustBundle { 19 | /// metadata contains the object metadata. 20 | /// +optional 21 | #[prost(message, optional, tag = "1")] 22 | pub metadata: ::core::option::Option, 23 | /// spec contains the signer (if any) and trust anchors. 24 | #[prost(message, optional, tag = "2")] 25 | pub spec: ::core::option::Option, 26 | } 27 | /// ClusterTrustBundleList is a collection of ClusterTrustBundle objects 28 | #[derive(Clone, PartialEq, ::prost::Message)] 29 | pub struct ClusterTrustBundleList { 30 | /// metadata contains the list metadata. 31 | /// 32 | /// +optional 33 | #[prost(message, optional, tag = "1")] 34 | pub metadata: ::core::option::Option, 35 | /// items is a collection of ClusterTrustBundle objects 36 | #[prost(message, repeated, tag = "2")] 37 | pub items: ::prost::alloc::vec::Vec, 38 | } 39 | /// ClusterTrustBundleSpec contains the signer and trust anchors. 40 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 41 | pub struct ClusterTrustBundleSpec { 42 | /// signerName indicates the associated signer, if any. 43 | /// 44 | /// In order to create or update a ClusterTrustBundle that sets signerName, 45 | /// you must have the following cluster-scoped permission: 46 | /// group=certificates.k8s.io resource=signers resourceName= 47 | /// verb=attest. 48 | /// 49 | /// If signerName is not empty, then the ClusterTrustBundle object must be 50 | /// named with the signer name as a prefix (translating slashes to colons). 51 | /// For example, for the signer name `example.com/foo`, valid 52 | /// ClusterTrustBundle object names include `example.com:foo:abc` and 53 | /// `example.com:foo:v1`. 54 | /// 55 | /// If signerName is empty, then the ClusterTrustBundle object's name must 56 | /// not have such a prefix. 57 | /// 58 | /// List/watch requests for ClusterTrustBundles can filter on this field 59 | /// using a `spec.signerName=NAME` field selector. 60 | /// 61 | /// +optional 62 | #[prost(string, optional, tag = "1")] 63 | pub signer_name: ::core::option::Option<::prost::alloc::string::String>, 64 | /// trustBundle contains the individual X.509 trust anchors for this 65 | /// bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. 66 | /// 67 | /// The data must consist only of PEM certificate blocks that parse as valid 68 | /// X.509 certificates. Each certificate must include a basic constraints 69 | /// extension with the CA bit set. The API server will reject objects that 70 | /// contain duplicate certificates, or that use PEM block headers. 71 | /// 72 | /// Users of ClusterTrustBundles, including Kubelet, are free to reorder and 73 | /// deduplicate certificate blocks in this file according to their own logic, 74 | /// as well as to drop PEM block headers and inter-block data. 75 | #[prost(string, optional, tag = "2")] 76 | pub trust_bundle: ::core::option::Option<::prost::alloc::string::String>, 77 | } 78 | 79 | impl crate::Resource for ClusterTrustBundle { 80 | const API_VERSION: &'static str = "certificates.k8s.io/v1alpha1"; 81 | const GROUP: &'static str = "certificates.k8s.io"; 82 | const VERSION: &'static str = "v1alpha1"; 83 | const KIND: &'static str = "ClusterTrustBundle"; 84 | const URL_PATH_SEGMENT: &'static str = "clustertrustbundles"; 85 | type Scope = crate::ClusterResourceScope; 86 | } 87 | impl crate::Metadata for ClusterTrustBundle { 88 | type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; 89 | fn metadata(&self) -> Option<&::Ty> { 90 | self.metadata.as_ref() 91 | } 92 | fn metadata_mut(&mut self) -> Option<&mut ::Ty> { 93 | self.metadata.as_mut() 94 | } 95 | } 96 | impl crate::HasSpec for ClusterTrustBundle { 97 | type Spec = crate::api::certificates::v1alpha1::ClusterTrustBundleSpec; 98 | fn spec(&self) -> Option<&::Spec> { 99 | self.spec.as_ref() 100 | } 101 | fn spec_mut(&mut self) -> Option<&mut ::Spec> { 102 | self.spec.as_mut() 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /k8s-pb/src/api/coordination/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha2; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/coordination/v1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Lease defines a lease concept. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Lease { 5 | /// More info: 6 | /// +optional 7 | #[prost(message, optional, tag = "1")] 8 | pub metadata: ::core::option::Option, 9 | /// spec contains the specification of the Lease. 10 | /// More info: 11 | /// +optional 12 | #[prost(message, optional, tag = "2")] 13 | pub spec: ::core::option::Option, 14 | } 15 | /// LeaseList is a list of Lease objects. 16 | #[derive(Clone, PartialEq, ::prost::Message)] 17 | pub struct LeaseList { 18 | /// Standard list metadata. 19 | /// More info: 20 | /// +optional 21 | #[prost(message, optional, tag = "1")] 22 | pub metadata: ::core::option::Option, 23 | /// items is a list of schema objects. 24 | #[prost(message, repeated, tag = "2")] 25 | pub items: ::prost::alloc::vec::Vec, 26 | } 27 | /// LeaseSpec is a specification of a Lease. 28 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 29 | pub struct LeaseSpec { 30 | /// holderIdentity contains the identity of the holder of a current lease. 31 | /// If Coordinated Leader Election is used, the holder identity must be 32 | /// equal to the elected LeaseCandidate.metadata.name field. 33 | /// +optional 34 | #[prost(string, optional, tag = "1")] 35 | pub holder_identity: ::core::option::Option<::prost::alloc::string::String>, 36 | /// leaseDurationSeconds is a duration that candidates for a lease need 37 | /// to wait to force acquire it. This is measured against the time of last 38 | /// observed renewTime. 39 | /// +optional 40 | #[prost(int32, optional, tag = "2")] 41 | pub lease_duration_seconds: ::core::option::Option, 42 | /// acquireTime is a time when the current lease was acquired. 43 | /// +optional 44 | #[prost(message, optional, tag = "3")] 45 | pub acquire_time: 46 | ::core::option::Option, 47 | /// renewTime is a time when the current holder of a lease has last 48 | /// updated the lease. 49 | /// +optional 50 | #[prost(message, optional, tag = "4")] 51 | pub renew_time: ::core::option::Option, 52 | /// leaseTransitions is the number of transitions of a lease between 53 | /// holders. 54 | /// +optional 55 | #[prost(int32, optional, tag = "5")] 56 | pub lease_transitions: ::core::option::Option, 57 | /// Strategy indicates the strategy for picking the leader for coordinated leader election. 58 | /// If the field is not specified, there is no active coordination for this lease. 59 | /// (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. 60 | /// +featureGate=CoordinatedLeaderElection 61 | /// +optional 62 | #[prost(string, optional, tag = "6")] 63 | pub strategy: ::core::option::Option<::prost::alloc::string::String>, 64 | /// PreferredHolder signals to a lease holder that the lease has a 65 | /// more optimal holder and should be given up. 66 | /// This field can only be set if Strategy is also set. 67 | /// +featureGate=CoordinatedLeaderElection 68 | /// +optional 69 | #[prost(string, optional, tag = "7")] 70 | pub preferred_holder: ::core::option::Option<::prost::alloc::string::String>, 71 | } 72 | 73 | impl crate::Resource for Lease { 74 | const API_VERSION: &'static str = "coordination.k8s.io/v1"; 75 | const GROUP: &'static str = "coordination.k8s.io"; 76 | const VERSION: &'static str = "v1"; 77 | const KIND: &'static str = "Lease"; 78 | const URL_PATH_SEGMENT: &'static str = "leases"; 79 | type Scope = crate::NamespaceResourceScope; 80 | } 81 | impl crate::Metadata for Lease { 82 | type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; 83 | fn metadata(&self) -> Option<&::Ty> { 84 | self.metadata.as_ref() 85 | } 86 | fn metadata_mut(&mut self) -> Option<&mut ::Ty> { 87 | self.metadata.as_mut() 88 | } 89 | } 90 | impl crate::HasSpec for Lease { 91 | type Spec = crate::api::coordination::v1::LeaseSpec; 92 | fn spec(&self) -> Option<&::Spec> { 93 | self.spec.as_ref() 94 | } 95 | fn spec_mut(&mut self) -> Option<&mut ::Spec> { 96 | self.spec.as_mut() 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /k8s-pb/src/api/coordination/v1alpha2/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// LeaseCandidate defines a candidate for a Lease object. 3 | /// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. 4 | #[derive(Clone, PartialEq, ::prost::Message)] 5 | pub struct LeaseCandidate { 6 | /// More info: 7 | /// +optional 8 | #[prost(message, optional, tag = "1")] 9 | pub metadata: ::core::option::Option, 10 | /// spec contains the specification of the Lease. 11 | /// More info: 12 | /// +optional 13 | #[prost(message, optional, tag = "2")] 14 | pub spec: ::core::option::Option, 15 | } 16 | /// LeaseCandidateList is a list of Lease objects. 17 | #[derive(Clone, PartialEq, ::prost::Message)] 18 | pub struct LeaseCandidateList { 19 | /// Standard list metadata. 20 | /// More info: 21 | /// +optional 22 | #[prost(message, optional, tag = "1")] 23 | pub metadata: ::core::option::Option, 24 | /// items is a list of schema objects. 25 | #[prost(message, repeated, tag = "2")] 26 | pub items: ::prost::alloc::vec::Vec, 27 | } 28 | /// LeaseCandidateSpec is a specification of a Lease. 29 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 30 | pub struct LeaseCandidateSpec { 31 | /// LeaseName is the name of the lease for which this candidate is contending. 32 | /// This field is immutable. 33 | /// +required 34 | #[prost(string, optional, tag = "1")] 35 | pub lease_name: ::core::option::Option<::prost::alloc::string::String>, 36 | /// PingTime is the last time that the server has requested the LeaseCandidate 37 | /// to renew. It is only done during leader election to check if any 38 | /// LeaseCandidates have become ineligible. When PingTime is updated, the 39 | /// LeaseCandidate will respond by updating RenewTime. 40 | /// +optional 41 | #[prost(message, optional, tag = "2")] 42 | pub ping_time: ::core::option::Option, 43 | /// RenewTime is the time that the LeaseCandidate was last updated. 44 | /// Any time a Lease needs to do leader election, the PingTime field 45 | /// is updated to signal to the LeaseCandidate that they should update 46 | /// the RenewTime. 47 | /// Old LeaseCandidate objects are also garbage collected if it has been hours 48 | /// since the last renew. The PingTime field is updated regularly to prevent 49 | /// garbage collection for still active LeaseCandidates. 50 | /// +optional 51 | #[prost(message, optional, tag = "3")] 52 | pub renew_time: ::core::option::Option, 53 | /// BinaryVersion is the binary version. It must be in a semver format without leading `v`. 54 | /// This field is required. 55 | /// +required 56 | #[prost(string, optional, tag = "4")] 57 | pub binary_version: ::core::option::Option<::prost::alloc::string::String>, 58 | /// EmulationVersion is the emulation version. It must be in a semver format without leading `v`. 59 | /// EmulationVersion must be less than or equal to BinaryVersion. 60 | /// This field is required when strategy is "OldestEmulationVersion" 61 | /// +optional 62 | #[prost(string, optional, tag = "5")] 63 | pub emulation_version: ::core::option::Option<::prost::alloc::string::String>, 64 | /// Strategy is the strategy that coordinated leader election will use for picking the leader. 65 | /// If multiple candidates for the same Lease return different strategies, the strategy provided 66 | /// by the candidate with the latest BinaryVersion will be used. If there is still conflict, 67 | /// this is a user error and coordinated leader election will not operate the Lease until resolved. 68 | /// +required 69 | #[prost(string, optional, tag = "6")] 70 | pub strategy: ::core::option::Option<::prost::alloc::string::String>, 71 | } 72 | 73 | impl crate::Resource for LeaseCandidate { 74 | const API_VERSION: &'static str = "coordination.k8s.io/v1alpha2"; 75 | const GROUP: &'static str = "coordination.k8s.io"; 76 | const VERSION: &'static str = "v1alpha2"; 77 | const KIND: &'static str = "LeaseCandidate"; 78 | const URL_PATH_SEGMENT: &'static str = "leasecandidates"; 79 | type Scope = crate::NamespaceResourceScope; 80 | } 81 | impl crate::Metadata for LeaseCandidate { 82 | type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; 83 | fn metadata(&self) -> Option<&::Ty> { 84 | self.metadata.as_ref() 85 | } 86 | fn metadata_mut(&mut self) -> Option<&mut ::Ty> { 87 | self.metadata.as_mut() 88 | } 89 | } 90 | impl crate::HasSpec for LeaseCandidate { 91 | type Spec = crate::api::coordination::v1alpha2::LeaseCandidateSpec; 92 | fn spec(&self) -> Option<&::Spec> { 93 | self.spec.as_ref() 94 | } 95 | fn spec_mut(&mut self) -> Option<&mut ::Spec> { 96 | self.spec.as_mut() 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /k8s-pb/src/api/core/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/api/discovery/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/events/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/extensions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1beta1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/api/flowcontrol/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | pub mod v1beta2; 4 | pub mod v1beta3; 5 | -------------------------------------------------------------------------------- /k8s-pb/src/api/imagepolicy/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1alpha1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/api/imagepolicy/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// ImageReview checks if the set of images in a pod are allowed. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct ImageReview { 5 | /// Standard object's metadata. 6 | /// More info: 7 | /// +optional 8 | #[prost(message, optional, tag = "1")] 9 | pub metadata: ::core::option::Option, 10 | /// Spec holds information about the pod being evaluated 11 | #[prost(message, optional, tag = "2")] 12 | pub spec: ::core::option::Option, 13 | /// Status is filled in by the backend and indicates whether the pod should be allowed. 14 | /// +optional 15 | #[prost(message, optional, tag = "3")] 16 | pub status: ::core::option::Option, 17 | } 18 | /// ImageReviewContainerSpec is a description of a container within the pod creation request. 19 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 20 | pub struct ImageReviewContainerSpec { 21 | /// This can be in the form image:tag or image@SHA:012345679abcdef. 22 | /// +optional 23 | #[prost(string, optional, tag = "1")] 24 | pub image: ::core::option::Option<::prost::alloc::string::String>, 25 | } 26 | /// ImageReviewSpec is a description of the pod creation request. 27 | #[derive(Clone, PartialEq, ::prost::Message)] 28 | pub struct ImageReviewSpec { 29 | /// Containers is a list of a subset of the information in each container of the Pod being created. 30 | /// +optional 31 | /// +listType=atomic 32 | #[prost(message, repeated, tag = "1")] 33 | pub containers: ::prost::alloc::vec::Vec, 34 | /// Annotations is a list of key-value pairs extracted from the Pod's annotations. 35 | /// It only includes keys which match the pattern `*.image-policy.k8s.io/*`. 36 | /// It is up to each webhook backend to determine how to interpret these annotations, if at all. 37 | /// +optional 38 | #[prost(btree_map = "string, string", tag = "2")] 39 | pub annotations: 40 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 41 | /// Namespace is the namespace the pod is being created in. 42 | /// +optional 43 | #[prost(string, optional, tag = "3")] 44 | pub namespace: ::core::option::Option<::prost::alloc::string::String>, 45 | } 46 | /// ImageReviewStatus is the result of the review for the pod creation request. 47 | #[derive(Clone, PartialEq, ::prost::Message)] 48 | pub struct ImageReviewStatus { 49 | /// Allowed indicates that all images were allowed to be run. 50 | #[prost(bool, optional, tag = "1")] 51 | pub allowed: ::core::option::Option, 52 | /// Reason should be empty unless Allowed is false in which case it 53 | /// may contain a short description of what is wrong. Kubernetes 54 | /// may truncate excessively long errors when displaying to the user. 55 | /// +optional 56 | #[prost(string, optional, tag = "2")] 57 | pub reason: ::core::option::Option<::prost::alloc::string::String>, 58 | /// AuditAnnotations will be added to the attributes object of the 59 | /// admission controller request using 'AddAnnotation'. The keys should 60 | /// be prefix-less (i.e., the admission controller will add an 61 | /// appropriate prefix). 62 | /// +optional 63 | #[prost(btree_map = "string, string", tag = "3")] 64 | pub audit_annotations: 65 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 66 | } 67 | -------------------------------------------------------------------------------- /k8s-pb/src/api/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod admission; 2 | pub mod admissionregistration; 3 | pub mod apidiscovery; 4 | pub mod apiserverinternal; 5 | pub mod apps; 6 | pub mod authentication; 7 | pub mod authorization; 8 | pub mod autoscaling; 9 | pub mod batch; 10 | pub mod certificates; 11 | pub mod coordination; 12 | pub mod core; 13 | pub mod discovery; 14 | pub mod events; 15 | pub mod extensions; 16 | pub mod flowcontrol; 17 | pub mod imagepolicy; 18 | pub mod networking; 19 | pub mod node; 20 | pub mod policy; 21 | pub mod rbac; 22 | pub mod resource; 23 | pub mod scheduling; 24 | pub mod storage; 25 | pub mod storagemigration; 26 | -------------------------------------------------------------------------------- /k8s-pb/src/api/networking/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/node/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/node/v1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Overhead structure represents the resource overhead associated with running a pod. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Overhead { 5 | /// podFixed represents the fixed resource overhead associated with running a pod. 6 | /// +optional 7 | #[prost(btree_map = "string, message", tag = "1")] 8 | pub pod_fixed: ::prost::alloc::collections::BTreeMap< 9 | ::prost::alloc::string::String, 10 | super::super::super::apimachinery::pkg::api::resource::Quantity, 11 | >, 12 | } 13 | /// RuntimeClass defines a class of container runtime supported in the cluster. 14 | /// The RuntimeClass is used to determine which container runtime is used to run 15 | /// all containers in a pod. RuntimeClasses are manually defined by a 16 | /// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 17 | /// responsible for resolving the RuntimeClassName reference before running the 18 | /// pod. For more details, see 19 | /// 20 | #[derive(Clone, PartialEq, ::prost::Message)] 21 | pub struct RuntimeClass { 22 | /// More info: 23 | /// +optional 24 | #[prost(message, optional, tag = "1")] 25 | pub metadata: ::core::option::Option, 26 | /// handler specifies the underlying runtime and configuration that the CRI 27 | /// implementation will use to handle pods of this class. The possible values 28 | /// are specific to the node & CRI configuration. It is assumed that all 29 | /// handlers are available on every node, and handlers of the same name are 30 | /// equivalent on every node. 31 | /// For example, a handler called "runc" might specify that the runc OCI 32 | /// runtime (using native Linux containers) will be used to run the containers 33 | /// in a pod. 34 | /// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, 35 | /// and is immutable. 36 | #[prost(string, optional, tag = "2")] 37 | pub handler: ::core::option::Option<::prost::alloc::string::String>, 38 | /// overhead represents the resource overhead associated with running a pod for a 39 | /// given RuntimeClass. For more details, see 40 | /// 41 | /// +optional 42 | #[prost(message, optional, tag = "3")] 43 | pub overhead: ::core::option::Option, 44 | /// scheduling holds the scheduling constraints to ensure that pods running 45 | /// with this RuntimeClass are scheduled to nodes that support it. 46 | /// If scheduling is nil, this RuntimeClass is assumed to be supported by all 47 | /// nodes. 48 | /// +optional 49 | #[prost(message, optional, tag = "4")] 50 | pub scheduling: ::core::option::Option, 51 | } 52 | /// RuntimeClassList is a list of RuntimeClass objects. 53 | #[derive(Clone, PartialEq, ::prost::Message)] 54 | pub struct RuntimeClassList { 55 | /// Standard list metadata. 56 | /// More info: 57 | /// +optional 58 | #[prost(message, optional, tag = "1")] 59 | pub metadata: ::core::option::Option, 60 | /// items is a list of schema objects. 61 | #[prost(message, repeated, tag = "2")] 62 | pub items: ::prost::alloc::vec::Vec, 63 | } 64 | /// Scheduling specifies the scheduling constraints for nodes supporting a 65 | /// RuntimeClass. 66 | #[derive(Clone, PartialEq, ::prost::Message)] 67 | pub struct Scheduling { 68 | /// nodeSelector lists labels that must be present on nodes that support this 69 | /// RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 70 | /// node matched by this selector. The RuntimeClass nodeSelector is merged 71 | /// with a pod's existing nodeSelector. Any conflicts will cause the pod to 72 | /// be rejected in admission. 73 | /// +optional 74 | /// +mapType=atomic 75 | #[prost(btree_map = "string, string", tag = "1")] 76 | pub node_selector: 77 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 78 | /// tolerations are appended (excluding duplicates) to pods running with this 79 | /// RuntimeClass during admission, effectively unioning the set of nodes 80 | /// tolerated by the pod and the RuntimeClass. 81 | /// +optional 82 | /// +listType=atomic 83 | #[prost(message, repeated, tag = "2")] 84 | pub tolerations: ::prost::alloc::vec::Vec, 85 | } 86 | 87 | impl crate::Resource for RuntimeClass { 88 | const API_VERSION: &'static str = "node.k8s.io/v1"; 89 | const GROUP: &'static str = "node.k8s.io"; 90 | const VERSION: &'static str = "v1"; 91 | const KIND: &'static str = "RuntimeClass"; 92 | const URL_PATH_SEGMENT: &'static str = "runtimeclasses"; 93 | type Scope = crate::ClusterResourceScope; 94 | } 95 | impl crate::Metadata for RuntimeClass { 96 | type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; 97 | fn metadata(&self) -> Option<&::Ty> { 98 | self.metadata.as_ref() 99 | } 100 | fn metadata_mut(&mut self) -> Option<&mut ::Ty> { 101 | self.metadata.as_mut() 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /k8s-pb/src/api/node/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Overhead structure represents the resource overhead associated with running a pod. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Overhead { 5 | /// podFixed represents the fixed resource overhead associated with running a pod. 6 | /// +optional 7 | #[prost(btree_map = "string, message", tag = "1")] 8 | pub pod_fixed: ::prost::alloc::collections::BTreeMap< 9 | ::prost::alloc::string::String, 10 | super::super::super::apimachinery::pkg::api::resource::Quantity, 11 | >, 12 | } 13 | /// RuntimeClass defines a class of container runtime supported in the cluster. 14 | /// The RuntimeClass is used to determine which container runtime is used to run 15 | /// all containers in a pod. RuntimeClasses are (currently) manually defined by a 16 | /// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 17 | /// responsible for resolving the RuntimeClassName reference before running the 18 | /// pod. For more details, see 19 | /// 20 | #[derive(Clone, PartialEq, ::prost::Message)] 21 | pub struct RuntimeClass { 22 | /// More info: 23 | /// +optional 24 | #[prost(message, optional, tag = "1")] 25 | pub metadata: ::core::option::Option, 26 | /// spec represents specification of the RuntimeClass 27 | /// More info: 28 | #[prost(message, optional, tag = "2")] 29 | pub spec: ::core::option::Option, 30 | } 31 | /// RuntimeClassList is a list of RuntimeClass objects. 32 | #[derive(Clone, PartialEq, ::prost::Message)] 33 | pub struct RuntimeClassList { 34 | /// Standard list metadata. 35 | /// More info: 36 | /// +optional 37 | #[prost(message, optional, tag = "1")] 38 | pub metadata: ::core::option::Option, 39 | /// items is a list of schema objects. 40 | #[prost(message, repeated, tag = "2")] 41 | pub items: ::prost::alloc::vec::Vec, 42 | } 43 | /// RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters 44 | /// that are required to describe the RuntimeClass to the Container Runtime 45 | /// Interface (CRI) implementation, as well as any other components that need to 46 | /// understand how the pod will be run. The RuntimeClassSpec is immutable. 47 | #[derive(Clone, PartialEq, ::prost::Message)] 48 | pub struct RuntimeClassSpec { 49 | /// runtimeHandler specifies the underlying runtime and configuration that the 50 | /// CRI implementation will use to handle pods of this class. The possible 51 | /// values are specific to the node & CRI configuration. It is assumed that 52 | /// all handlers are available on every node, and handlers of the same name are 53 | /// equivalent on every node. 54 | /// For example, a handler called "runc" might specify that the runc OCI 55 | /// runtime (using native Linux containers) will be used to run the containers 56 | /// in a pod. 57 | /// The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123) 58 | /// requirements, and is immutable. 59 | #[prost(string, optional, tag = "1")] 60 | pub runtime_handler: ::core::option::Option<::prost::alloc::string::String>, 61 | /// overhead represents the resource overhead associated with running a pod for a 62 | /// given RuntimeClass. For more details, see 63 | /// 64 | /// +optional 65 | #[prost(message, optional, tag = "2")] 66 | pub overhead: ::core::option::Option, 67 | /// scheduling holds the scheduling constraints to ensure that pods running 68 | /// with this RuntimeClass are scheduled to nodes that support it. 69 | /// If scheduling is nil, this RuntimeClass is assumed to be supported by all 70 | /// nodes. 71 | /// +optional 72 | #[prost(message, optional, tag = "3")] 73 | pub scheduling: ::core::option::Option, 74 | } 75 | /// Scheduling specifies the scheduling constraints for nodes supporting a 76 | /// RuntimeClass. 77 | #[derive(Clone, PartialEq, ::prost::Message)] 78 | pub struct Scheduling { 79 | /// nodeSelector lists labels that must be present on nodes that support this 80 | /// RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 81 | /// node matched by this selector. The RuntimeClass nodeSelector is merged 82 | /// with a pod's existing nodeSelector. Any conflicts will cause the pod to 83 | /// be rejected in admission. 84 | /// +optional 85 | /// +mapType=atomic 86 | #[prost(btree_map = "string, string", tag = "1")] 87 | pub node_selector: 88 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 89 | /// tolerations are appended (excluding duplicates) to pods running with this 90 | /// RuntimeClass during admission, effectively unioning the set of nodes 91 | /// tolerated by the pod and the RuntimeClass. 92 | /// +optional 93 | /// +listType=atomic 94 | #[prost(message, repeated, tag = "2")] 95 | pub tolerations: ::prost::alloc::vec::Vec, 96 | } 97 | -------------------------------------------------------------------------------- /k8s-pb/src/api/node/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Overhead structure represents the resource overhead associated with running a pod. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Overhead { 5 | /// podFixed represents the fixed resource overhead associated with running a pod. 6 | /// +optional 7 | #[prost(btree_map = "string, message", tag = "1")] 8 | pub pod_fixed: ::prost::alloc::collections::BTreeMap< 9 | ::prost::alloc::string::String, 10 | super::super::super::apimachinery::pkg::api::resource::Quantity, 11 | >, 12 | } 13 | /// RuntimeClass defines a class of container runtime supported in the cluster. 14 | /// The RuntimeClass is used to determine which container runtime is used to run 15 | /// all containers in a pod. RuntimeClasses are (currently) manually defined by a 16 | /// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is 17 | /// responsible for resolving the RuntimeClassName reference before running the 18 | /// pod. For more details, see 19 | /// 20 | #[derive(Clone, PartialEq, ::prost::Message)] 21 | pub struct RuntimeClass { 22 | /// More info: 23 | /// +optional 24 | #[prost(message, optional, tag = "1")] 25 | pub metadata: ::core::option::Option, 26 | /// handler specifies the underlying runtime and configuration that the CRI 27 | /// implementation will use to handle pods of this class. The possible values 28 | /// are specific to the node & CRI configuration. It is assumed that all 29 | /// handlers are available on every node, and handlers of the same name are 30 | /// equivalent on every node. 31 | /// For example, a handler called "runc" might specify that the runc OCI 32 | /// runtime (using native Linux containers) will be used to run the containers 33 | /// in a pod. 34 | /// The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, 35 | /// and is immutable. 36 | #[prost(string, optional, tag = "2")] 37 | pub handler: ::core::option::Option<::prost::alloc::string::String>, 38 | /// overhead represents the resource overhead associated with running a pod for a 39 | /// given RuntimeClass. For more details, see 40 | /// 41 | /// +optional 42 | #[prost(message, optional, tag = "3")] 43 | pub overhead: ::core::option::Option, 44 | /// scheduling holds the scheduling constraints to ensure that pods running 45 | /// with this RuntimeClass are scheduled to nodes that support it. 46 | /// If scheduling is nil, this RuntimeClass is assumed to be supported by all 47 | /// nodes. 48 | /// +optional 49 | #[prost(message, optional, tag = "4")] 50 | pub scheduling: ::core::option::Option, 51 | } 52 | /// RuntimeClassList is a list of RuntimeClass objects. 53 | #[derive(Clone, PartialEq, ::prost::Message)] 54 | pub struct RuntimeClassList { 55 | /// Standard list metadata. 56 | /// More info: 57 | /// +optional 58 | #[prost(message, optional, tag = "1")] 59 | pub metadata: ::core::option::Option, 60 | /// items is a list of schema objects. 61 | #[prost(message, repeated, tag = "2")] 62 | pub items: ::prost::alloc::vec::Vec, 63 | } 64 | /// Scheduling specifies the scheduling constraints for nodes supporting a 65 | /// RuntimeClass. 66 | #[derive(Clone, PartialEq, ::prost::Message)] 67 | pub struct Scheduling { 68 | /// nodeSelector lists labels that must be present on nodes that support this 69 | /// RuntimeClass. Pods using this RuntimeClass can only be scheduled to a 70 | /// node matched by this selector. The RuntimeClass nodeSelector is merged 71 | /// with a pod's existing nodeSelector. Any conflicts will cause the pod to 72 | /// be rejected in admission. 73 | /// +optional 74 | /// +mapType=atomic 75 | #[prost(btree_map = "string, string", tag = "1")] 76 | pub node_selector: 77 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 78 | /// tolerations are appended (excluding duplicates) to pods running with this 79 | /// RuntimeClass during admission, effectively unioning the set of nodes 80 | /// tolerated by the pod and the RuntimeClass. 81 | /// +optional 82 | /// +listType=atomic 83 | #[prost(message, repeated, tag = "2")] 84 | pub tolerations: ::prost::alloc::vec::Vec, 85 | } 86 | -------------------------------------------------------------------------------- /k8s-pb/src/api/policy/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/api/rbac/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/resource/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1alpha3; 2 | pub mod v1beta1; 3 | pub mod v1beta2; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/scheduling/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/scheduling/v1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// PriorityClass defines mapping from a priority class name to the priority 3 | /// integer value. The value can be any valid integer. 4 | #[derive(Clone, PartialEq, ::prost::Message)] 5 | pub struct PriorityClass { 6 | /// Standard object's metadata. 7 | /// More info: 8 | /// +optional 9 | #[prost(message, optional, tag = "1")] 10 | pub metadata: ::core::option::Option, 11 | /// value represents the integer value of this priority class. This is the actual priority that pods 12 | /// receive when they have the name of this class in their pod spec. 13 | #[prost(int32, optional, tag = "2")] 14 | pub value: ::core::option::Option, 15 | /// globalDefault specifies whether this PriorityClass should be considered as 16 | /// the default priority for pods that do not have any priority class. 17 | /// Only one PriorityClass can be marked as `globalDefault`. However, if more than 18 | /// one PriorityClasses exists with their `globalDefault` field set to true, 19 | /// the smallest value of such global default PriorityClasses will be used as the default priority. 20 | /// +optional 21 | #[prost(bool, optional, tag = "3")] 22 | pub global_default: ::core::option::Option, 23 | /// description is an arbitrary string that usually provides guidelines on 24 | /// when this priority class should be used. 25 | /// +optional 26 | #[prost(string, optional, tag = "4")] 27 | pub description: ::core::option::Option<::prost::alloc::string::String>, 28 | /// preemptionPolicy is the Policy for preempting pods with lower priority. 29 | /// One of Never, PreemptLowerPriority. 30 | /// Defaults to PreemptLowerPriority if unset. 31 | /// +optional 32 | #[prost(string, optional, tag = "5")] 33 | pub preemption_policy: ::core::option::Option<::prost::alloc::string::String>, 34 | } 35 | /// PriorityClassList is a collection of priority classes. 36 | #[derive(Clone, PartialEq, ::prost::Message)] 37 | pub struct PriorityClassList { 38 | /// Standard list metadata 39 | /// More info: 40 | /// +optional 41 | #[prost(message, optional, tag = "1")] 42 | pub metadata: ::core::option::Option, 43 | /// items is the list of PriorityClasses 44 | #[prost(message, repeated, tag = "2")] 45 | pub items: ::prost::alloc::vec::Vec, 46 | } 47 | 48 | impl crate::Resource for PriorityClass { 49 | const API_VERSION: &'static str = "scheduling.k8s.io/v1"; 50 | const GROUP: &'static str = "scheduling.k8s.io"; 51 | const VERSION: &'static str = "v1"; 52 | const KIND: &'static str = "PriorityClass"; 53 | const URL_PATH_SEGMENT: &'static str = "priorityclasses"; 54 | type Scope = crate::ClusterResourceScope; 55 | } 56 | impl crate::Metadata for PriorityClass { 57 | type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; 58 | fn metadata(&self) -> Option<&::Ty> { 59 | self.metadata.as_ref() 60 | } 61 | fn metadata_mut(&mut self) -> Option<&mut ::Ty> { 62 | self.metadata.as_mut() 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /k8s-pb/src/api/scheduling/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. 3 | /// PriorityClass defines mapping from a priority class name to the priority 4 | /// integer value. The value can be any valid integer. 5 | #[derive(Clone, PartialEq, ::prost::Message)] 6 | pub struct PriorityClass { 7 | /// Standard object's metadata. 8 | /// More info: 9 | /// +optional 10 | #[prost(message, optional, tag = "1")] 11 | pub metadata: ::core::option::Option, 12 | /// value represents the integer value of this priority class. This is the actual priority that pods 13 | /// receive when they have the name of this class in their pod spec. 14 | #[prost(int32, optional, tag = "2")] 15 | pub value: ::core::option::Option, 16 | /// globalDefault specifies whether this PriorityClass should be considered as 17 | /// the default priority for pods that do not have any priority class. 18 | /// Only one PriorityClass can be marked as `globalDefault`. However, if more than 19 | /// one PriorityClasses exists with their `globalDefault` field set to true, 20 | /// the smallest value of such global default PriorityClasses will be used as the default priority. 21 | /// +optional 22 | #[prost(bool, optional, tag = "3")] 23 | pub global_default: ::core::option::Option, 24 | /// description is an arbitrary string that usually provides guidelines on 25 | /// when this priority class should be used. 26 | /// +optional 27 | #[prost(string, optional, tag = "4")] 28 | pub description: ::core::option::Option<::prost::alloc::string::String>, 29 | /// preemptionPolicy is the Policy for preempting pods with lower priority. 30 | /// One of Never, PreemptLowerPriority. 31 | /// Defaults to PreemptLowerPriority if unset. 32 | /// +optional 33 | #[prost(string, optional, tag = "5")] 34 | pub preemption_policy: ::core::option::Option<::prost::alloc::string::String>, 35 | } 36 | /// PriorityClassList is a collection of priority classes. 37 | #[derive(Clone, PartialEq, ::prost::Message)] 38 | pub struct PriorityClassList { 39 | /// Standard list metadata 40 | /// More info: 41 | /// +optional 42 | #[prost(message, optional, tag = "1")] 43 | pub metadata: ::core::option::Option, 44 | /// items is the list of PriorityClasses 45 | #[prost(message, repeated, tag = "2")] 46 | pub items: ::prost::alloc::vec::Vec, 47 | } 48 | -------------------------------------------------------------------------------- /k8s-pb/src/api/scheduling/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. 3 | /// PriorityClass defines mapping from a priority class name to the priority 4 | /// integer value. The value can be any valid integer. 5 | #[derive(Clone, PartialEq, ::prost::Message)] 6 | pub struct PriorityClass { 7 | /// Standard object's metadata. 8 | /// More info: 9 | /// +optional 10 | #[prost(message, optional, tag = "1")] 11 | pub metadata: ::core::option::Option, 12 | /// value represents the integer value of this priority class. This is the actual priority that pods 13 | /// receive when they have the name of this class in their pod spec. 14 | #[prost(int32, optional, tag = "2")] 15 | pub value: ::core::option::Option, 16 | /// globalDefault specifies whether this PriorityClass should be considered as 17 | /// the default priority for pods that do not have any priority class. 18 | /// Only one PriorityClass can be marked as `globalDefault`. However, if more than 19 | /// one PriorityClasses exists with their `globalDefault` field set to true, 20 | /// the smallest value of such global default PriorityClasses will be used as the default priority. 21 | /// +optional 22 | #[prost(bool, optional, tag = "3")] 23 | pub global_default: ::core::option::Option, 24 | /// description is an arbitrary string that usually provides guidelines on 25 | /// when this priority class should be used. 26 | /// +optional 27 | #[prost(string, optional, tag = "4")] 28 | pub description: ::core::option::Option<::prost::alloc::string::String>, 29 | /// preemptionPolicy is the Policy for preempting pods with lower priority. 30 | /// One of Never, PreemptLowerPriority. 31 | /// Defaults to PreemptLowerPriority if unset. 32 | /// +optional 33 | #[prost(string, optional, tag = "5")] 34 | pub preemption_policy: ::core::option::Option<::prost::alloc::string::String>, 35 | } 36 | /// PriorityClassList is a collection of priority classes. 37 | #[derive(Clone, PartialEq, ::prost::Message)] 38 | pub struct PriorityClassList { 39 | /// Standard list metadata 40 | /// More info: 41 | /// +optional 42 | #[prost(message, optional, tag = "1")] 43 | pub metadata: ::core::option::Option, 44 | /// items is the list of PriorityClasses 45 | #[prost(message, repeated, tag = "2")] 46 | pub items: ::prost::alloc::vec::Vec, 47 | } 48 | -------------------------------------------------------------------------------- /k8s-pb/src/api/storage/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1alpha1; 3 | pub mod v1beta1; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/api/storagemigration/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1alpha1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apiextensions_apiserver/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pkg; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apiextensions_apiserver/pkg/apis/apiextensions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/apiextensions_apiserver/pkg/apis/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apiextensions; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apiextensions_apiserver/pkg/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apis; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pkg; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/api/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod resource; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/api/resource/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Quantity is a fixed-point representation of a number. 3 | /// It provides convenient marshaling/unmarshaling in JSON and YAML, 4 | /// in addition to String() and AsInt64() accessors. 5 | /// 6 | /// The serialization format is: 7 | /// 8 | /// ``` 9 | /// ::= 10 | /// 11 | /// (Note that may be empty, from the "" case in .) 12 | /// 13 | /// ::= 0 | 1 | ... | 9 14 | /// ::= | 15 | /// ::= | . | . | . 16 | /// ::= "+" | "-" 17 | /// ::= | 18 | /// ::= | | 19 | /// ::= Ki | Mi | Gi | Ti | Pi | Ei 20 | /// 21 | /// (International System of units; See: ) 22 | /// 23 | /// ::= m | "" | k | M | G | T | P | E 24 | /// 25 | /// (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.) 26 | /// 27 | /// ::= "e" | "E" 28 | /// ``` 29 | /// 30 | /// No matter which of the three exponent forms is used, no quantity may represent 31 | /// a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal 32 | /// places. Numbers larger or more precise will be capped or rounded up. 33 | /// (E.g.: 0.1m will rounded up to 1m.) 34 | /// This may be extended in the future if we require larger or smaller quantities. 35 | /// 36 | /// When a Quantity is parsed from a string, it will remember the type of suffix 37 | /// it had, and will use the same type again when it is serialized. 38 | /// 39 | /// Before serializing, Quantity will be put in "canonical form". 40 | /// This means that Exponent/suffix will be adjusted up or down (with a 41 | /// corresponding increase or decrease in Mantissa) such that: 42 | /// 43 | /// - No precision is lost 44 | /// - No fractional digits will be emitted 45 | /// - The exponent (or suffix) is as large as possible. 46 | /// 47 | /// The sign will be omitted unless the number is negative. 48 | /// 49 | /// Examples: 50 | /// 51 | /// - 1.5 will be serialized as "1500m" 52 | /// - 1.5Gi will be serialized as "1536Mi" 53 | /// 54 | /// Note that the quantity will NEVER be internally represented by a 55 | /// floating point number. That is the whole point of this exercise. 56 | /// 57 | /// Non-canonical values will still parse as long as they are well formed, 58 | /// but will be re-emitted in their canonical form. (So always use canonical 59 | /// form, or don't diff.) 60 | /// 61 | /// This format is intended to make it difficult to use these numbers without 62 | /// writing some sort of special handling code in the hopes that that will 63 | /// cause implementors to also use a fixed point implementation. 64 | /// 65 | /// +protobuf=true 66 | /// +protobuf.embed=string 67 | /// +protobuf.options.marshal=false 68 | /// +protobuf.options.(gogoproto.goproto_stringer)=false 69 | /// +k8s:deepcopy-gen=true 70 | /// +k8s:openapi-gen=true 71 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 72 | pub struct Quantity { 73 | #[prost(string, optional, tag = "1")] 74 | pub string: ::core::option::Option<::prost::alloc::string::String>, 75 | } 76 | /// QuantityValue makes it possible to use a Quantity as value for a command 77 | /// line parameter. 78 | /// 79 | /// +protobuf=true 80 | /// +protobuf.embed=string 81 | /// +protobuf.options.marshal=false 82 | /// +protobuf.options.(gogoproto.goproto_stringer)=false 83 | /// +k8s:deepcopy-gen=true 84 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 85 | pub struct QuantityValue { 86 | #[prost(string, optional, tag = "1")] 87 | pub string: ::core::option::Option<::prost::alloc::string::String>, 88 | } 89 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/apis/meta/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/apis/meta/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// PartialObjectMetadataList contains a list of objects containing only their metadata. 3 | /// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4 | #[derive(Clone, PartialEq, ::prost::Message)] 5 | pub struct PartialObjectMetadataList { 6 | /// Standard list metadata. 7 | /// More info: 8 | /// +optional 9 | #[prost(message, optional, tag = "2")] 10 | pub metadata: ::core::option::Option, 11 | /// items contains each of the included items. 12 | #[prost(message, repeated, tag = "1")] 13 | pub items: ::prost::alloc::vec::Vec, 14 | } 15 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/apis/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod meta; 2 | pub mod testapigroup; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/apis/testapigroup/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod api; 2 | pub mod apis; 3 | pub mod runtime; 4 | pub mod util; 5 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/runtime/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// RawExtension is used to hold extensions in external versions. 3 | /// 4 | /// To use this, make a field which has RawExtension as its type in your external, versioned 5 | /// struct, and Object in your internal struct. You also need to register your 6 | /// various plugin types. 7 | /// 8 | /// // Internal package: 9 | /// 10 | /// type MyAPIObject struct { 11 | /// runtime.TypeMeta `json:",inline"` 12 | /// MyPlugin runtime.Object `json:"myPlugin"` 13 | /// } 14 | /// 15 | /// type PluginA struct { 16 | /// AOption string `json:"aOption"` 17 | /// } 18 | /// 19 | /// // External package: 20 | /// 21 | /// type MyAPIObject struct { 22 | /// runtime.TypeMeta `json:",inline"` 23 | /// MyPlugin runtime.RawExtension `json:"myPlugin"` 24 | /// } 25 | /// 26 | /// type PluginA struct { 27 | /// AOption string `json:"aOption"` 28 | /// } 29 | /// 30 | /// // On the wire, the JSON will look something like this: 31 | /// 32 | /// { 33 | /// "kind":"MyAPIObject", 34 | /// "apiVersion":"v1", 35 | /// "myPlugin": { 36 | /// "kind":"PluginA", 37 | /// "aOption":"foo", 38 | /// }, 39 | /// } 40 | /// 41 | /// So what happens? Decode first uses json or yaml to unmarshal the serialized data into 42 | /// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. 43 | /// The next step is to copy (using pkg/conversion) into the internal struct. The runtime 44 | /// package's DefaultScheme has conversion functions installed which will unpack the 45 | /// JSON stored in RawExtension, turning it into the correct object type, and storing it 46 | /// in the Object. (TODO: In the case where the object is of an unknown type, a 47 | /// runtime.Unknown object will be created and stored.) 48 | /// 49 | /// +k8s:deepcopy-gen=true 50 | /// +protobuf=true 51 | /// +k8s:openapi-gen=true 52 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 53 | pub struct RawExtension { 54 | /// Raw is the underlying serialization of this object. 55 | /// 56 | /// TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data. 57 | #[prost(bytes = "vec", optional, tag = "1")] 58 | pub raw: ::core::option::Option<::prost::alloc::vec::Vec>, 59 | } 60 | /// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, 61 | /// like this: 62 | /// 63 | /// type MyAwesomeAPIObject struct { 64 | /// runtime.TypeMeta `json:",inline"` 65 | /// ... // other fields 66 | /// } 67 | /// 68 | /// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind 69 | /// 70 | /// TypeMeta is provided here for convenience. You may use it directly from this package or define 71 | /// your own with the same fields. 72 | /// 73 | /// +k8s:deepcopy-gen=false 74 | /// +protobuf=true 75 | /// +k8s:openapi-gen=true 76 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 77 | pub struct TypeMeta { 78 | /// +optional 79 | #[prost(string, optional, tag = "1")] 80 | pub api_version: ::core::option::Option<::prost::alloc::string::String>, 81 | /// +optional 82 | #[prost(string, optional, tag = "2")] 83 | pub kind: ::core::option::Option<::prost::alloc::string::String>, 84 | } 85 | /// Unknown allows api objects with unknown types to be passed-through. This can be used 86 | /// to deal with the API objects from a plug-in. Unknown objects still have functioning 87 | /// TypeMeta features-- kind, version, etc. 88 | /// TODO: Make this object have easy access to field based accessors and settors for 89 | /// metadata and field mutatation. 90 | /// 91 | /// +k8s:deepcopy-gen=true 92 | /// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 93 | /// +protobuf=true 94 | /// +k8s:openapi-gen=true 95 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 96 | pub struct Unknown { 97 | #[prost(message, optional, tag = "1")] 98 | pub type_meta: ::core::option::Option, 99 | /// Raw will hold the complete serialized object which couldn't be matched 100 | /// with a registered type. Most likely, nothing should be done with this 101 | /// except for passing it through the system. 102 | #[prost(bytes = "vec", optional, tag = "2")] 103 | pub raw: ::core::option::Option<::prost::alloc::vec::Vec>, 104 | /// ContentEncoding is encoding used to encode 'Raw' data. 105 | /// Unspecified means no encoding. 106 | #[prost(string, optional, tag = "3")] 107 | pub content_encoding: ::core::option::Option<::prost::alloc::string::String>, 108 | /// ContentType is serialization method used to serialize 'Raw'. 109 | /// Unspecified means ContentTypeJSON. 110 | #[prost(string, optional, tag = "4")] 111 | pub content_type: ::core::option::Option<::prost::alloc::string::String>, 112 | } 113 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/util/intstr/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// IntOrString is a type that can hold an int32 or a string. When used in 3 | /// JSON or YAML marshalling and unmarshalling, it produces or consumes the 4 | /// inner type. This allows you to have, for example, a JSON field that can 5 | /// accept a name or number. 6 | /// TODO: Rename to Int32OrString 7 | /// 8 | /// +protobuf=true 9 | /// +protobuf.options.(gogoproto.goproto_stringer)=false 10 | /// +k8s:openapi-gen=true 11 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 12 | pub struct IntOrString { 13 | #[prost(int64, optional, tag = "1")] 14 | pub r#type: ::core::option::Option, 15 | #[prost(int32, optional, tag = "2")] 16 | pub int_val: ::core::option::Option, 17 | #[prost(string, optional, tag = "3")] 18 | pub str_val: ::core::option::Option<::prost::alloc::string::String>, 19 | } 20 | -------------------------------------------------------------------------------- /k8s-pb/src/apimachinery/pkg/util/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod intstr; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/kube_aggregator/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pkg; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/kube_aggregator/pkg/apis/apiregistration/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/kube_aggregator/pkg/apis/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apiregistration; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/kube_aggregator/pkg/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apis; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod api; 2 | pub mod apiextensions_apiserver; 3 | pub mod apimachinery; 4 | pub mod kube_aggregator; 5 | pub mod metrics; 6 | 7 | #[doc = r" The scope of a [`Resource`]."] 8 | pub trait ResourceScope {} 9 | #[doc = r" Indicates that a [`Resource`] is cluster-scoped."] 10 | pub struct ClusterResourceScope {} 11 | impl ResourceScope for ClusterResourceScope {} 12 | #[doc = r" Indicates that a [`Resource`] is namespace-scoped."] 13 | pub struct NamespaceResourceScope {} 14 | impl ResourceScope for NamespaceResourceScope {} 15 | #[doc = r" Indicates that a [`Resource`] is neither cluster-scoped nor namespace-scoped."] 16 | pub struct SubResourceScope {} 17 | impl ResourceScope for SubResourceScope {} 18 | #[doc = r" A trait applied to all Kubernetes resources."] 19 | pub trait Resource { 20 | #[doc = r#" The API version of the resource. This is a composite of [`Resource::GROUP`] and [`Resource::VERSION`] (eg `"apiextensions.k8s.io/v1beta1"`)"#] 21 | #[doc = r#" or just the version for resources without a group (eg `"v1"`)."#] 22 | #[doc = r""] 23 | #[doc = r" This is the string used in the `apiVersion` field of the resource's serialized form."] 24 | const API_VERSION: &'static str; 25 | #[doc = r" The group of the resource, or the empty string if the resource doesn't have a group."] 26 | const GROUP: &'static str; 27 | #[doc = r" The kind of the resource."] 28 | #[doc = r""] 29 | #[doc = r" This is the string used in the `kind` field of the resource's serialized form."] 30 | const KIND: &'static str; 31 | #[doc = r" The version of the resource."] 32 | const VERSION: &'static str; 33 | #[doc = r" The URL path segment used to construct URLs related to this resource."] 34 | #[doc = r""] 35 | #[doc = r" For cluster- and namespaced-scoped resources, this is the plural name of the resource that is followed by the resource name."] 36 | #[doc = r#" For example, [`api::core::v1::Pod`](crate::api::core::v1::Pod)'s value is `"pods"` and its URLs look like `.../pods/{name}`."#] 37 | #[doc = r""] 38 | #[doc = r" For subresources, this is the subresource name that comes after the parent resource's name."] 39 | #[doc = r#" For example, [`api::authentication::v1::TokenRequest`](crate::api::authentication::v1::TokenRequest)'s value is `"token"`,"#] 40 | #[doc = r" and its URLs look like `.../serviceaccounts/{name}/token`."] 41 | const URL_PATH_SEGMENT: &'static str; 42 | #[doc = r" Indicates whether the resource is namespace-scoped or cluster-scoped or a subresource."] 43 | #[doc = r""] 44 | #[doc = r" If you need to restrict some generic code to resources of a specific scope, use this associated type to create a bound on the generic."] 45 | #[doc = r" For example, `fn foo>() { }` can only be called with cluster-scoped resources."] 46 | type Scope: ResourceScope; 47 | } 48 | #[doc = r" A trait applied to all Kubernetes resources that have Metadata"] 49 | pub trait Metadata: Resource { 50 | type Ty; 51 | fn metadata(&self) -> Option<&Self::Ty>; 52 | fn metadata_mut(&mut self) -> Option<&mut Self::Ty>; 53 | } 54 | pub trait HasSpec { 55 | type Spec; 56 | fn spec(&self) -> Option<&Self::Spec>; 57 | fn spec_mut(&mut self) -> Option<&mut Self::Spec>; 58 | } 59 | pub trait HasStatus { 60 | type Status; 61 | fn status(&self) -> Option<&Self::Status>; 62 | fn status_mut(&mut self) -> Option<&mut Self::Status>; 63 | } 64 | pub trait HasConditions { 65 | type Condition; 66 | fn conditions(&self) -> Option<&[Self::Condition]>; 67 | fn conditions_mut(&mut self) -> Option<&mut Vec>; 68 | } 69 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pkg; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/custom_metrics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1beta1; 2 | pub mod v1beta2; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/custom_metrics/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// MetricListOptions is used to select metrics by their label selectors 3 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 4 | pub struct MetricListOptions { 5 | /// A selector to restrict the list of returned objects by their labels. 6 | /// Defaults to everything. 7 | /// +optional 8 | #[prost(string, optional, tag = "1")] 9 | pub label_selector: ::core::option::Option<::prost::alloc::string::String>, 10 | /// A selector to restrict the list of returned metrics by their labels 11 | /// +optional 12 | #[prost(string, optional, tag = "2")] 13 | pub metric_label_selector: ::core::option::Option<::prost::alloc::string::String>, 14 | } 15 | /// MetricValue is a metric value for some object 16 | #[derive(Clone, PartialEq, ::prost::Message)] 17 | pub struct MetricValue { 18 | /// a reference to the described object 19 | #[prost(message, optional, tag = "1")] 20 | pub described_object: 21 | ::core::option::Option, 22 | /// the name of the metric 23 | #[prost(string, optional, tag = "2")] 24 | pub metric_name: ::core::option::Option<::prost::alloc::string::String>, 25 | /// indicates the time at which the metrics were produced 26 | #[prost(message, optional, tag = "3")] 27 | pub timestamp: 28 | ::core::option::Option, 29 | /// indicates the window (\[Timestamp-Window, Timestamp\]) from 30 | /// which these metrics were calculated, when returning rate 31 | /// metrics calculated from cumulative metrics (or zero for 32 | /// non-calculated instantaneous metrics). 33 | #[prost(int64, optional, tag = "4")] 34 | pub window: ::core::option::Option, 35 | /// the value of the metric for this 36 | #[prost(message, optional, tag = "5")] 37 | pub value: 38 | ::core::option::Option, 39 | /// selector represents the label selector that could be used to select 40 | /// this metric, and will generally just be the selector passed in to 41 | /// the query used to fetch this metric. 42 | /// When left blank, only the metric's Name will be used to gather metrics. 43 | /// +optional 44 | #[prost(message, optional, tag = "6")] 45 | pub selector: ::core::option::Option< 46 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector, 47 | >, 48 | } 49 | /// MetricValueList is a list of values for a given metric for some set of objects 50 | #[derive(Clone, PartialEq, ::prost::Message)] 51 | pub struct MetricValueList { 52 | #[prost(message, optional, tag = "1")] 53 | pub metadata: ::core::option::Option< 54 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 55 | >, 56 | /// the value of the metric across the described objects 57 | #[prost(message, repeated, tag = "2")] 58 | pub items: ::prost::alloc::vec::Vec, 59 | } 60 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/custom_metrics/v1beta2/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// MetricIdentifier identifies a metric by name and, optionally, selector 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct MetricIdentifier { 5 | /// name is the name of the given metric 6 | #[prost(string, optional, tag = "1")] 7 | pub name: ::core::option::Option<::prost::alloc::string::String>, 8 | /// selector represents the label selector that could be used to select 9 | /// this metric, and will generally just be the selector passed in to 10 | /// the query used to fetch this metric. 11 | /// When left blank, only the metric's Name will be used to gather metrics. 12 | /// +optional 13 | #[prost(message, optional, tag = "2")] 14 | pub selector: ::core::option::Option< 15 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector, 16 | >, 17 | } 18 | /// MetricListOptions is used to select metrics by their label selectors 19 | #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] 20 | pub struct MetricListOptions { 21 | /// A selector to restrict the list of returned objects by their labels. 22 | /// Defaults to everything. 23 | /// +optional 24 | #[prost(string, optional, tag = "1")] 25 | pub label_selector: ::core::option::Option<::prost::alloc::string::String>, 26 | /// A selector to restrict the list of returned metrics by their labels 27 | /// +optional 28 | #[prost(string, optional, tag = "2")] 29 | pub metric_label_selector: ::core::option::Option<::prost::alloc::string::String>, 30 | } 31 | /// MetricValue is the metric value for some object 32 | #[derive(Clone, PartialEq, ::prost::Message)] 33 | pub struct MetricValue { 34 | /// a reference to the described object 35 | #[prost(message, optional, tag = "1")] 36 | pub described_object: 37 | ::core::option::Option, 38 | #[prost(message, optional, tag = "2")] 39 | pub metric: ::core::option::Option, 40 | /// indicates the time at which the metrics were produced 41 | #[prost(message, optional, tag = "3")] 42 | pub timestamp: 43 | ::core::option::Option, 44 | /// indicates the window (\[Timestamp-Window, Timestamp\]) from 45 | /// which these metrics were calculated, when returning rate 46 | /// metrics calculated from cumulative metrics (or zero for 47 | /// non-calculated instantaneous metrics). 48 | #[prost(int64, optional, tag = "4")] 49 | pub window_seconds: ::core::option::Option, 50 | /// the value of the metric for this 51 | #[prost(message, optional, tag = "5")] 52 | pub value: 53 | ::core::option::Option, 54 | } 55 | /// MetricValueList is a list of values for a given metric for some set of objects 56 | #[derive(Clone, PartialEq, ::prost::Message)] 57 | pub struct MetricValueList { 58 | #[prost(message, optional, tag = "1")] 59 | pub metadata: ::core::option::Option< 60 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 61 | >, 62 | /// the value of the metric across the described objects 63 | #[prost(message, repeated, tag = "2")] 64 | pub items: ::prost::alloc::vec::Vec, 65 | } 66 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/external_metrics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1beta1; 2 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/external_metrics/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// ExternalMetricValue is a metric value for external metric 3 | /// A single metric value is identified by metric name and a set of string labels. 4 | /// For one metric there can be multiple values with different sets of labels. 5 | #[derive(Clone, PartialEq, ::prost::Message)] 6 | pub struct ExternalMetricValue { 7 | /// the name of the metric 8 | #[prost(string, optional, tag = "1")] 9 | pub metric_name: ::core::option::Option<::prost::alloc::string::String>, 10 | /// a set of labels that identify a single time series for the metric 11 | #[prost(btree_map = "string, string", tag = "2")] 12 | pub metric_labels: 13 | ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>, 14 | /// indicates the time at which the metrics were produced 15 | #[prost(message, optional, tag = "3")] 16 | pub timestamp: 17 | ::core::option::Option, 18 | /// indicates the window (\[Timestamp-Window, Timestamp\]) from 19 | /// which these metrics were calculated, when returning rate 20 | /// metrics calculated from cumulative metrics (or zero for 21 | /// non-calculated instantaneous metrics). 22 | #[prost(int64, optional, tag = "4")] 23 | pub window: ::core::option::Option, 24 | /// the value of the metric 25 | #[prost(message, optional, tag = "5")] 26 | pub value: 27 | ::core::option::Option, 28 | } 29 | /// ExternalMetricValueList is a list of values for a given metric for some set labels 30 | #[derive(Clone, PartialEq, ::prost::Message)] 31 | pub struct ExternalMetricValueList { 32 | #[prost(message, optional, tag = "1")] 33 | pub metadata: ::core::option::Option< 34 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 35 | >, 36 | /// value of the metric matching a given set of labels 37 | #[prost(message, repeated, tag = "2")] 38 | pub items: ::prost::alloc::vec::Vec, 39 | } 40 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/metrics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod v1alpha1; 2 | pub mod v1beta1; 3 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/metrics/v1alpha1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// ContainerMetrics sets resource usage metrics of a container. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct ContainerMetrics { 5 | /// Container name corresponding to the one from pod.spec.containers. 6 | #[prost(string, optional, tag = "1")] 7 | pub name: ::core::option::Option<::prost::alloc::string::String>, 8 | /// The memory usage is the memory working set. 9 | #[prost(btree_map = "string, message", tag = "2")] 10 | pub usage: ::prost::alloc::collections::BTreeMap< 11 | ::prost::alloc::string::String, 12 | super::super::super::super::super::apimachinery::pkg::api::resource::Quantity, 13 | >, 14 | } 15 | /// NodeMetrics sets resource usage metrics of a node. 16 | #[derive(Clone, PartialEq, ::prost::Message)] 17 | pub struct NodeMetrics { 18 | /// Standard object's metadata. 19 | /// More info: 20 | /// +optional 21 | #[prost(message, optional, tag = "1")] 22 | pub metadata: ::core::option::Option< 23 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta, 24 | >, 25 | /// The following fields define time interval from which metrics were 26 | /// collected from the interval \[Timestamp-Window, Timestamp\]. 27 | #[prost(message, optional, tag = "2")] 28 | pub timestamp: 29 | ::core::option::Option, 30 | #[prost(message, optional, tag = "3")] 31 | pub window: ::core::option::Option< 32 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::Duration, 33 | >, 34 | /// The memory usage is the memory working set. 35 | #[prost(btree_map = "string, message", tag = "4")] 36 | pub usage: ::prost::alloc::collections::BTreeMap< 37 | ::prost::alloc::string::String, 38 | super::super::super::super::super::apimachinery::pkg::api::resource::Quantity, 39 | >, 40 | } 41 | /// NodeMetricsList is a list of NodeMetrics. 42 | #[derive(Clone, PartialEq, ::prost::Message)] 43 | pub struct NodeMetricsList { 44 | /// Standard list metadata. 45 | /// More info: 46 | #[prost(message, optional, tag = "1")] 47 | pub metadata: ::core::option::Option< 48 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 49 | >, 50 | /// List of node metrics. 51 | #[prost(message, repeated, tag = "2")] 52 | pub items: ::prost::alloc::vec::Vec, 53 | } 54 | /// PodMetrics sets resource usage metrics of a pod. 55 | #[derive(Clone, PartialEq, ::prost::Message)] 56 | pub struct PodMetrics { 57 | /// Standard object's metadata. 58 | /// More info: 59 | /// +optional 60 | #[prost(message, optional, tag = "1")] 61 | pub metadata: ::core::option::Option< 62 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta, 63 | >, 64 | /// The following fields define time interval from which metrics were 65 | /// collected from the interval \[Timestamp-Window, Timestamp\]. 66 | #[prost(message, optional, tag = "2")] 67 | pub timestamp: 68 | ::core::option::Option, 69 | #[prost(message, optional, tag = "3")] 70 | pub window: ::core::option::Option< 71 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::Duration, 72 | >, 73 | /// Metrics for all containers are collected within the same time window. 74 | /// +listType=atomic 75 | #[prost(message, repeated, tag = "4")] 76 | pub containers: ::prost::alloc::vec::Vec, 77 | } 78 | /// PodMetricsList is a list of PodMetrics. 79 | #[derive(Clone, PartialEq, ::prost::Message)] 80 | pub struct PodMetricsList { 81 | /// Standard list metadata. 82 | /// More info: 83 | #[prost(message, optional, tag = "1")] 84 | pub metadata: ::core::option::Option< 85 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 86 | >, 87 | /// List of pod metrics. 88 | #[prost(message, repeated, tag = "2")] 89 | pub items: ::prost::alloc::vec::Vec, 90 | } 91 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/metrics/v1beta1/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// ContainerMetrics sets resource usage metrics of a container. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct ContainerMetrics { 5 | /// Container name corresponding to the one from pod.spec.containers. 6 | #[prost(string, optional, tag = "1")] 7 | pub name: ::core::option::Option<::prost::alloc::string::String>, 8 | /// The memory usage is the memory working set. 9 | #[prost(btree_map = "string, message", tag = "2")] 10 | pub usage: ::prost::alloc::collections::BTreeMap< 11 | ::prost::alloc::string::String, 12 | super::super::super::super::super::apimachinery::pkg::api::resource::Quantity, 13 | >, 14 | } 15 | /// NodeMetrics sets resource usage metrics of a node. 16 | #[derive(Clone, PartialEq, ::prost::Message)] 17 | pub struct NodeMetrics { 18 | /// Standard object's metadata. 19 | /// More info: 20 | /// +optional 21 | #[prost(message, optional, tag = "1")] 22 | pub metadata: ::core::option::Option< 23 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta, 24 | >, 25 | /// The following fields define time interval from which metrics were 26 | /// collected from the interval \[Timestamp-Window, Timestamp\]. 27 | #[prost(message, optional, tag = "2")] 28 | pub timestamp: 29 | ::core::option::Option, 30 | #[prost(message, optional, tag = "3")] 31 | pub window: ::core::option::Option< 32 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::Duration, 33 | >, 34 | /// The memory usage is the memory working set. 35 | #[prost(btree_map = "string, message", tag = "4")] 36 | pub usage: ::prost::alloc::collections::BTreeMap< 37 | ::prost::alloc::string::String, 38 | super::super::super::super::super::apimachinery::pkg::api::resource::Quantity, 39 | >, 40 | } 41 | /// NodeMetricsList is a list of NodeMetrics. 42 | #[derive(Clone, PartialEq, ::prost::Message)] 43 | pub struct NodeMetricsList { 44 | /// Standard list metadata. 45 | /// More info: 46 | #[prost(message, optional, tag = "1")] 47 | pub metadata: ::core::option::Option< 48 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 49 | >, 50 | /// List of node metrics. 51 | #[prost(message, repeated, tag = "2")] 52 | pub items: ::prost::alloc::vec::Vec, 53 | } 54 | /// PodMetrics sets resource usage metrics of a pod. 55 | #[derive(Clone, PartialEq, ::prost::Message)] 56 | pub struct PodMetrics { 57 | /// Standard object's metadata. 58 | /// More info: 59 | /// +optional 60 | #[prost(message, optional, tag = "1")] 61 | pub metadata: ::core::option::Option< 62 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta, 63 | >, 64 | /// The following fields define time interval from which metrics were 65 | /// collected from the interval \[Timestamp-Window, Timestamp\]. 66 | #[prost(message, optional, tag = "2")] 67 | pub timestamp: 68 | ::core::option::Option, 69 | #[prost(message, optional, tag = "3")] 70 | pub window: ::core::option::Option< 71 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::Duration, 72 | >, 73 | /// Metrics for all containers are collected within the same time window. 74 | /// +listType=atomic 75 | #[prost(message, repeated, tag = "4")] 76 | pub containers: ::prost::alloc::vec::Vec, 77 | } 78 | /// PodMetricsList is a list of PodMetrics. 79 | #[derive(Clone, PartialEq, ::prost::Message)] 80 | pub struct PodMetricsList { 81 | /// Standard list metadata. 82 | /// More info: 83 | #[prost(message, optional, tag = "1")] 84 | pub metadata: ::core::option::Option< 85 | super::super::super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta, 86 | >, 87 | /// List of pod metrics. 88 | #[prost(message, repeated, tag = "2")] 89 | pub items: ::prost::alloc::vec::Vec, 90 | } 91 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/apis/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod custom_metrics; 2 | pub mod external_metrics; 3 | pub mod metrics; 4 | -------------------------------------------------------------------------------- /k8s-pb/src/metrics/pkg/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apis; 2 | -------------------------------------------------------------------------------- /release.toml: -------------------------------------------------------------------------------- 1 | # Release process 2 | # 3 | # Run `cargo release minor` to publish and create and push a signed tag 4 | 5 | push = true 6 | tag = true 7 | sign-tag = true 8 | sign-commit = true 9 | enable-all-features = true 10 | tag-name = "{{version}}" 11 | 12 | # Ref: https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md 13 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | $schema: "https://docs.renovatebot.com/renovate-schema.json", 3 | extends: [ 4 | "config:base", 5 | ":gitSignOff", 6 | ":disableDependencyDashboard" 7 | ], 8 | ignorePaths: ["k8s-pb*/**"], 9 | postUpgradeTasks: { 10 | commands: ["just generate"] 11 | }, 12 | prBodyNotes: [ 13 | "{{#if isMinor}}:warning: Kubernetes Minor :warning:{{/if}}", 14 | "This PR bumps the Kubernetes version in the justfile and runs just renovate.", 15 | "{{#if isMinor}}Please check for inconsistencies in the new version{{/if}}", 16 | ], 17 | customManagers: [ 18 | { 19 | customType: "regex", 20 | fileMatch: ["^justfile$"], 21 | matchStrings: [ 22 | // example: 23 | // renovate: datasource=github-releases depName=clux/whyq versioning=semver 24 | //KUBERNETES_VERSION := "x.x.x" 25 | "renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?\\s.*?_VERSION \\:= \"(?.*)\"", 26 | ], 27 | versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", 28 | extractVersionTemplate: '^?(?\\d+\\.\\d+\\.\\d+)', 29 | }, 30 | ], 31 | } 32 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | newline_style = "Unix" 2 | max_width = 110 3 | --------------------------------------------------------------------------------