diff --git a/.dockerignore b/.dockerignore index 0eb859e1..c44c672e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,14 @@ .git/ bin/ testbin/ +.idea/ +.kustomize/ +.github/ +hack/ +doc/ +assets/ +examples/ +helm-charts/ +sidecar/ +test/ +config/ \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..f4e4633a --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,20 @@ +### Expected behavior + +What do you want to achieve? + +### Actual behavior + +What is happening? + +### Steps to reproduce the behavior + +Describe step by step what you've done to get to this behavior + +### Environment + +How are the pieces configured? +* Tarantool Operator version +* Tarantool version +* Cartridge version +* Kubernetes version +* Helm chart configuration used diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0cf68812 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +### All Submissions: + +* [ ] Have you opened an Issue before filing this PR? +* [ ] Is linter passing? +* [ ] Are the tests passing? +* [ ] Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..4b5ca8ef --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: "/" + schedule: + interval: weekly + day: monday + reviewers: + - "kluevandrew" diff --git a/.github/workflows/destroy-deployment.yml b/.github/workflows/destroy-deployment.yml deleted file mode 100644 index 5e7ec3e0..00000000 --- a/.github/workflows/destroy-deployment.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Destroy-deployments - -on: - pull_request: - paths: - - 'doc/**/*' - types: - - closed -jobs: - destroy-deployment: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Set branch name from source branch - run: echo "BRANCH_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV - - - name: Remove dev server deployment at ${{env.DEPLOYMENT_NAME}} - uses: strumwolf/delete-deployment-environment@v2 - with: - token: "${{ secrets.TARANTOOLBOT_TOKEN }}" - environment: "translation-${{env.BRANCH_NAME}}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..b70af8d2 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint + +on: + pull_request: + branches: + - master + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Go 1.19.3 + uses: actions/setup-go@v3 + with: + go-version: 1.19.3 + - name: Lint the code + uses: golangci/golangci-lint-action@v3 + with: + args: -v --timeout 2m --config .golangci.yml + version: v1.50.1 diff --git a/.github/workflows/pull-translation.yml b/.github/workflows/pull-translation.yml deleted file mode 100644 index f61fa598..00000000 --- a/.github/workflows/pull-translation.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Pull translations - -on: - workflow_dispatch: - branches: - - '!master' -jobs: - pull-translations: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - token: ${{secrets.TARANTOOLBOT_TOKEN}} - - - name: Set branch name from source branch - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Setup Python environment - uses: actions/setup-python@v2 - - - name: Setup Python requirements - run: | - python -m pip install --upgrade pip - pip install -r doc/requirements.txt - - - name: Pull translations from Crowdin - uses: crowdin/github-action@1.0.21 - with: - config: 'doc/crowdin.yaml' - upload_sources: false - upload_translations: false - push_translations: false - download_translations: true - download_language: 'ru' - crowdin_branch_name: ${{env.BRANCH_NAME}} - debug_mode: true - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - CROWDIN_PERSONAL_TOKEN: ${{secrets.CROWDIN_PERSONAL_TOKEN}} - - - name: Cleanup translation files - run: | - sudo chown -R runner:docker doc/locale/ru/LC_MESSAGES - python doc/cleanup.py po - - - name: Commit translation files - uses: stefanzweifel/git-auto-commit-action@v4.1.2 - with: - commit_message: "Update translations" - file_pattern: "*.po" diff --git a/.github/workflows/push-translation.yml b/.github/workflows/push-translation.yml deleted file mode 100644 index 113e5691..00000000 --- a/.github/workflows/push-translation.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Push translation sources - -on: - pull_request: - paths: - - 'doc/**/*.rst' - - 'doc/conf.py' - - '.github/workflows/push-translation.yml' -jobs: - push-translation-sources: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set branch name from source branch - run: echo "BRANCH_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV - - - name: Start translation service deployment - uses: bobheadxi/deployments@v0.5.2 - id: translation - with: - step: start - token: ${{secrets.GITHUB_TOKEN}} - env: translation-${{env.BRANCH_NAME}} - ref: ${{github.head_ref}} - - - name: Setup Python environment - uses: actions/setup-python@v2 - - - name: Setup Python requirements - run: | - python -m pip install --upgrade pip - pip install -r doc/requirements.txt - - - name: Build pot files - run: python -m sphinx . doc/locale/en -c doc -b gettext - - - name: Push POT files to crowdin - uses: crowdin/github-action@1.0.21 - with: - upload_sources: true - upload_translations: false - crowdin_branch_name: ${{env.BRANCH_NAME}} - config: 'doc/crowdin.yaml' - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - CROWDIN_PERSONAL_TOKEN: ${{secrets.CROWDIN_PERSONAL_TOKEN}} - - - name: update deployment status - uses: bobheadxi/deployments@v0.5.2 - with: - step: finish - token: ${{secrets.GITHUB_TOKEN}} - status: ${{job.status}} - deployment_id: ${{steps.translation.outputs.deployment_id}} - env_url: https://crowdin.com/project/tarantool-cartridge-cli/ru#/${{env.BRANCH_NAME}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9a207d22 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release operator + +on: + release: + types: + - published + push: + branches: + - master + +jobs: + push_to_registry: + name: Push Docker image to Docker registry + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Log in to Docker Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: tarantool/tarantool-operator + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 840d35c4..5be4eb5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,142 +1,20 @@ -name: Test -on: [push] +name: Unit tests + +on: + pull_request: + branches: + - master jobs: - lint: - name: lint + test: + name: unit testing runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: lint - uses: golangci/golangci-lint-action@v2 + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Go 1.19.3 + uses: actions/setup-go@v3 with: - args: --timeout 2m - - controllers_testing: - name: controllers_testing - runs-on: ubuntu-latest - needs: lint - env: - KIND_CLUSTER_NAME: kind-cluster - - strategy: - matrix: - kubernetes-version: [v1.16.4, v1.19.4, v1.22.4, v1.23.4] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Go 1.18 - uses: actions/setup-go@v3 - with: - go-version: 1.18 - id: go - - - name: Set up Kind Cluster - uses: helm/kind-action@v1.2.0 - with: - node_image: kindest/node:${{ matrix.kubernetes-version }} - cluster_name: ${{ env.KIND_CLUSTER_NAME }} - - - name: Test - run: make gotest - - e2e_testing: - name: e2e_testing - runs-on: ubuntu-latest - needs: lint - env: - KIND_CLUSTER_NAME: kind-cluster - OPERATOR_NAMESPACE: tarantool-operator - APP_NAMESPACE: tarantool-app - OPERATOR_IMAGE_REPO: tarantool-operator - OPERATOR_IMAGE_TAG: 0.0.0 - - strategy: - fail-fast: false - matrix: - kubernetes-version: [v1.16.4, v1.19.4, v1.22.4, v1.23.4] - - steps: - - uses: actions/checkout@v1 - - - name: Set up helm - uses: azure/setup-helm@v1 - - - name: Set up Kind Cluster - uses: helm/kind-action@v1.2.0 - with: - node_image: kindest/node:${{ matrix.kubernetes-version }} - cluster_name: ${{ env.KIND_CLUSTER_NAME }} - - - name: Prepare Tarantool operator Docker image - run: | - make docker-build REPO=${{ env.OPERATOR_IMAGE_REPO }} VERSION=${{ env.OPERATOR_IMAGE_TAG }} - kind load docker-image ${{ env.OPERATOR_IMAGE_REPO }}:${{ env.OPERATOR_IMAGE_TAG }} \ - --name ${{ env.KIND_CLUSTER_NAME }} - - - name: Install Tarantool Operator in Kind - run: | - # Set the default namespace - kubectl config set-context --current --namespace=${{ env.OPERATOR_NAMESPACE }} - - helm install -n ${{ env.OPERATOR_NAMESPACE }} operator helm-charts/tarantool-operator \ - --create-namespace \ - --set image.repository=${{ env.OPERATOR_IMAGE_REPO }} \ - --set image.tag=${{ env.OPERATOR_IMAGE_TAG }} - - - name: Waiting for Operator Deployment availability - run: kubectl wait deployment/controller-manager --for=condition=available --timeout=60s || true - - - name: Сhecking the number of available replicas - run: | - available_num=$(kubectl get deployments/controller-manager -o=jsonpath="{.status.availableReplicas}") - desired_num=$(kubectl get deployments/controller-manager -o=jsonpath="{.status.replicas}") - - if [[ $available_num -ne $desired_num ]]; then - kubectl describe deployments/controller-manager - echo 'ERROR: invalid number of available replicas...' >&2; exit 1 - fi - - - name: Install Tarantool Cartridge app in Kind - run: | - # Set the default namespace - kubectl config set-context --current --namespace=${{ env.APP_NAMESPACE }} - - helm install -n ${{ env.APP_NAMESPACE }} --create-namespace \ - -f test/helpers/ci/cluster_values.yaml \ - cartridge-app \ - helm-charts/tarantool-cartridge - - - name: Waiting for routers Pods availability - run: for i in {1..60}; do kubectl wait -n ${{ env.APP_NAMESPACE }} --for=condition=ready pod --timeout=180s -l tarantool.io/role=router && break || sleep 1; done - - - name: Сhecking the number of ready router replicas - run : | - desired_routers_num=1 - ready_routers_num=$(kubectl get statefulsets/router-0 -o=jsonpath="{.status.readyReplicas}") - - if [[ $ready_routers_num -ne $desired_routers_num ]]; then - kubectl describe statefulsets/router-0 - kubectl describe pod -l tarantool.io/role=router - echo 'ERROR: invalid number of ready routers...' >&2; exit 1 - fi - - - name: Waiting for storages availability - run: kubectl wait --for=condition=ready pod --timeout=180s -l tarantool.io/role=storage || true - - - name: Сhecking the number of ready storage replicas - run: | - desired_storage_num=1 - ready_storage_num=$(kubectl get statefulsets/storage-0 -o=jsonpath="{.status.readyReplicas}") - - if [[ $ready_storage_num -ne $desired_storage_num ]]; then - kubectl describe statefulsets/storage-0 - kubectl describe pod -l tarantool.io/role=storage - echo 'ERROR: invalid number of ready storages...' >&2; exit 1 - fi - - - - + go-version: 1.19.3 + - name: Test + run: go test ./... -coverprofile cover.out diff --git a/.github/workflows/upload-translations.yml b/.github/workflows/upload-translations.yml deleted file mode 100644 index 75a88c4e..00000000 --- a/.github/workflows/upload-translations.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Update translations on the main branch - -on: - push: - paths: - - 'doc/**/*.rst' - - 'doc/locale/**/*.po' - - '.github/workflows/upload-translations.yml' - branches: - - master -jobs: - autocommit-pot-files: - runs-on: ubuntu-latest - - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Python environment - uses: actions/setup-python@v2 - - - name: Setup Python requirements - run: | - python -m pip install --upgrade pip - pip install -r doc/requirements.txt - - - name: Build pot files - run: python -m sphinx . doc/locale/en -c doc -b gettext - - - name: Push Pot-files to crowdin - uses: crowdin/github-action@1.1.0 - with: - config: 'doc/crowdin.yaml' - upload_sources: true - upload_translations: true - import_eq_suggestions: true - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - CROWDIN_PERSONAL_TOKEN: ${{secrets.CROWDIN_PERSONAL_TOKEN}} diff --git a/.gitignore b/.gitignore index e641e3f5..51ca2ec2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ - # Binaries for programs and plugins *.exe *.exe~ @@ -17,6 +16,8 @@ testbin/* # Kubernetes Generated files - skip generated files, except for vendored files !vendor/**/zz_generated.* +config/tarantool.io_*.yaml +.kustomize # editor and IDE paraphernalia .idea diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..82aba833 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,57 @@ +run: + timeout: 5m + go: '1.19' + +linters: + enable-all: true + disable: + - nosnakecase # Replaced by 'unused' + - varcheck # Replaced by 'unused' + - deadcode # Replaced by 'unused + - golint # Replaced by 'revive' + - exhaustivestruct # Replaced by 'exhaustruct' + - interfacer # The repository of the linter has been archived by the owner + - scopelint # Replaced by 'exportloopref' + - ifshort # The repository of the linter has been deprecated by the owner + - maligned # Replaced by govet 'fieldalignment' + - structcheck # Replaced by 'unused' + - rowserrcheck # is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649 + - sqlclosecheck # is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649 + - wastedassign # is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649 + + # Want to fix + - godox # we still have fixme's + - cyclop + - funlen + - revive # dot-imports + - stylecheck # dot-imports + - gomnd # dot-imports + - lll + - gocognit # Need to refactor 2 functions + - nestif # Need to refactor 2 functions + - goimports # see https://github.com/golangci/golangci-lint/issues/1490 + + # Not acceptable at all + - gochecknoinits + - exhaustruct + - gochecknoglobals + - paralleltest + - goerr113 + - ireturn + - interfacebloat + - wrapcheck + - containedctx + - dupword + - nonamedreturns + - tagliatelle + - varnamelen + - nilnil + +issues: + exclude-rules: + - path: 'test/mocks/(.+)\.go' + linters: + - forcetypeassert + - path: 'test/utils/(.+)\.go' + linters: + - gosec diff --git a/CHANGELOG.md b/CHANGELOG.md index ce8113ab..5b71b087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,22 +5,41 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.0.0-rc1] ### Added -- Makefile with a full set of targets for all occasions - -### Changed -- The Tarantool Operator is installed in a separate namespace +- A completely new version of operator does not have any compatibility with versions less than 1.0.0-rc1 +- Migration guide from 1.0.0-rc1 +- API `tarantoo.io/v1beta1` - Bump operator-sdk version (and other dependencies) -- Refactor project structure, all helm charts are collected in one place -- Update crds api version from `apiextensions.k8s.io/v1beta1` to `apiextensions.k8s.io/v1` -- Updated kv example to the most recent cartridge version -- Update cartridge version for tarantool-cartridge and crud examples to the latest v2.7.3 +- HELM charts is now placed in standalone repository https://github.com/tarantool/helm-charts +- Update CRDs api version from `apiextensions.k8s.io/v1beta1` to `apiextensions.k8s.io/v1` +- Example cartridge is now placed in standalone repository +- Custom license +- Configurable image pull secrets +- Ability to configure cluster cookie +- Ability to configure application pods resources +- Ability to configure operator pods resources +- Release automation +- Ability to pass custom environment variables to application +- Update StatefulSet fields on the fly +- Configurable vshard groups +- Configurable vshard weights +- Configurable failover +- A lot of configurable params in new helm charts +- Publish kubernetes events with useful info +- Topology leader switch +- Release automatically +- Support kubectl version 1.25+ -### Fixed +### Removed +- API `tarantoo.io/v1alpha1` is not serve anymore +### Fixed - Operator was not able to manage multiple cartridge clusters in multiple namespaces +- Remove all deprecated cartridge calls +- Reconciling every 5 second +- After restart minikube, tarantool cluster cannot be configured ## [0.0.9] - 2021-03-30 diff --git a/Dockerfile b/Dockerfile index 5a355c21..825e35a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.18 as builder +FROM golang:1.19.3 as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -10,9 +10,7 @@ COPY go.sum go.sum RUN go mod download # Copy the go source -COPY main.go main.go -COPY api/ api/ -COPY controllers/ controllers/ +COPY . . # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go diff --git a/LICENSE b/LICENSE index 52967994..6ca18e8a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,25 +1,145 @@ -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + TARANTOOL COMMUNITY EDITION LICENSE + Version 1, November 21, 2022 + +Copyright © 2022 LLC VK Digital Technologies +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + + TERMS AND CONDITIONS + +0. Definitions. +"This License" refers to Tarantool community edition license. +"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. +"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. +To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. +A "covered work" means either the unmodified Program or a work based on the Program. +To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. +To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. +An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + + +1. Source Code. +The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. +A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. +The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. +The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. +The Corresponding Source for a work in source code form is that same work. + + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program, subject to section 13 of the License. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work, or if you are offering the Program as a Service (see section 13 of the License). This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. +Subject to section 13 of the License, you may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee, subject to section 13 of the License. + + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: +a) The work must carry prominent notices stating that you modified it, and giving a relevant date. +b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". +c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. +d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: +a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. +b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. +c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. +d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. +e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. +A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. +"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + + +7. Additional Terms. +"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: +a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or +b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or +c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or +d) Limiting the use for publicity purposes of names of licensors or authors of the material; or +e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or +f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. +All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. +For the avoidance of doubt, you (including any modified or altered versions of the Program) are in any case subject to Section 13 of the License, and you may not exclude it in any way. + + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program only for noncommercial use. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work or use the Program. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, or by using the Program for commercial purposes (including the Program in your software for the purpose of commercial use and/or distribution and/or offering the Program as a Service) you indicate your acceptance of this License to do so. + + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. +An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + + +11. Patents. +A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". +A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. +In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. +A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot use, propagate or convey a covered work so as to simultaneously satisfy your obligations under this License and any other pertinent obligations, then as a consequence you may not use, propagate or convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + + +13. Including the Program in your software for the purpose of commercial use and/or distribution and/or offering the Program as a Service +Under the License “Including the Program in your software for the purpose of commercial use and/or distribution and/or making the functionality of the Program or a modified version available to third parties as a service” includes (but is not limited to this) any of the above actions: +- Producing for the purpose of commercial use and/or distributing (on a model other than SaaS) your own software product based on an unmodified version of Program; +- Producing for the purpose of commercial use and/or distributing (on a model other than SaaS) your own software product based on a modified (including the inclusion of Program code in its own software code) version of Program; +- Providing and/or distributing your own product on SaaS model using modified Program code (including inclusion of Program code in its own program code); +- Providing and/or distributing your own product on a SaaS model using an unmodified version of Program. +Making the functionality of the Program or modified version available to third parties as a service also includes, without limitation, enabling third parties to interact with the functionality of the Program or modified version remotely through a computer network, offering a service the value of which entirely or primarily derives from the value of the Program or modified version, or offering a service that accomplishes for users the primary purpose of the Program or modified version. If you include the Program in your software for the purpose of commercial use and/or distribution and/or make the functionality of the Program or a modified version available to third parties as a service, you must (on your choice): +a) make available via network download to everyone at no charge, under the terms of this License the Service Source Code, your software and all software which you program, support, modify, or interact the other way using this Service Source Code. +“Service Source Code” means the Corresponding Source for the Program or the modified version, and the Corresponding Source for all programs that you use to make the Program or modified version available as a service, including, without limitation, management software, user interfaces, application program interfaces, automation software, monitoring software, backup software, storage software and hosting software, all such that a user could run an instance of the service using the Service Source Code you make available. +b) conclude a separate agreement with VK Digital Technologies LLC and get a license for commercial use by making the functionality of the Program or a modified version available to third parties as a service. + + +14. Revised Versions of this License. +VK Digital Technologies LLC may publish revised and/or new versions of the Tarantool community edition license from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the Tarantool community edition license "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the VK Digital Technologies LLC. If the Program does not specify a version number of the Tarantool community edition license, you may choose any version ever published by the VK Digital Technologies LLC. +If the Program specifies that a proxy can decide which future versions of the Tarantool community edition license can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS diff --git a/Makefile b/Makefile index d8ccab90..f9d604ea 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 0.0.11 +VERSION ?= 1.0.0-rc1 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") @@ -28,16 +28,29 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) # This variable is used to construct full image tags for bundle and catalog images. # # For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both -# tarantool.io/tarantool-operator-bundle:$VERSION and tarantool.io/tarantool-operator-catalog:$VERSION. -IMAGE_TAG_BASE ?= tarantool.io/tarantool-operator +# tarantool.io/tarantool-operator-ce-bundle:$VERSION and tarantool.io/tarantool-operator-ce-catalog:$VERSION. +IMAGE_TAG_BASE ?= tarantool.io/tarantool-operator-ce # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) +# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command +BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) + +# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests +# You can enable this value if you would like to use SHA Based Digests +# To enable set flag to true +USE_IMAGE_DIGESTS ?= false +ifeq ($(USE_IMAGE_DIGESTS), true) + BUNDLE_GEN_FLAGS += --use-image-digests +endif + # Image URL to use all building/pushing image targets -REPO ?= tarantool-operator -IMG ?= $(REPO):$(VERSION) +REPO ?= tarantool/tarantool-operator +IMG ?= ${REPO}:${VERSION} +# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. +ENVTEST_K8S_VERSION = 1.24.2 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -47,11 +60,11 @@ GOBIN=$(shell go env GOBIN) endif # Setting SHELL to bash allows bash commands to be executed by recipes. -# This is a requirement for 'setup-envtest.sh' in the test target. # Options are set to exit when a recipe line exits non-zero or a piped command fails. SHELL = /usr/bin/env bash -o pipefail .SHELLFLAGS = -ec +.PHONY: all all: build ##@ General @@ -67,167 +80,115 @@ all: build # More info on the awk command: # http://linuxcommand.org/lc3_adv_awk.php +.PHONY: help help: ## Display this help. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) ##@ Development +.PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." crd:generateEmbeddedObjectMeta=true output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." \ + crd:generateEmbeddedObjectMeta=true,maxDescLen=0 \ + output:crd:artifacts:config=config/crd/bases +.PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." +.PHONY: fmt fmt: ## Run go fmt against code. go fmt ./... +.PHONY: vet vet: ## Run go vet against code. go vet ./... -gotest: - go test ./... -coverprofile cover.out ; - -test: manifests generate fmt vet kind-start - echo "Run tests" ; \ - $(MAKE) gotest KUBECONFIG=$(KIND_KUBECONFIG) || ($(MAKE) kind-stop || true; exit 1); \ - $(MAKE) kind-stop || true ; - -##@ KIND Cluster. More info: https://kind.sigs.k8s.io/docs -KIND_VERSION ?= v0.12.0 -KIND_CLUSTER_NAME ?= "tarantool-operator-testing" -KIND=$(shell pwd)/bin/kind -KIND_IMAGE=kindest/node:v1.23.4@sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9 -KIND_KUBECONFIG=$(shell pwd)/bin/kubeconfig.yml - -kind-install: - @[ -f $(KIND) ] || { \ - OS=$(shell go env GOOS) ; \ - ARCH=$(shell go env GOARCH) ; \ - URL=https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$${OS}-$${ARCH} ; \ - echo "Downloading kind $${URL}" ; \ - curl -sSLo ${KIND} $${URL} ; \ - chmod +x $(KIND) ; \ - } - -kind-start: kind-install - EXISTS=$$($(KIND) get clusters | grep -c $(KIND_CLUSTER_NAME)) ; \ - if [ $$EXISTS -eq "0" ] ; then \ - $(KIND) create cluster --image=$(KIND_IMAGE) --name=$(KIND_CLUSTER_NAME) --kubeconfig=$(KIND_KUBECONFIG) || exit 1; \ - fi; \ - KUBECONFIG="$(KIND_KUBECONFIG)" kubectl cluster-info ; \ - echo "Kind cluster ready" ; +lint: ## Lint the code + golangci-lint run -v --fix -kind-stop: kind-install - $(KIND) delete cluster --name=$(KIND_CLUSTER_NAME) ; \ - rm -f $(KIND_KUBECONFIG) ; +.PHONY: test +test: manifests generate fmt vet envtest ## Run tests. + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out ##@ Build +.PHONY: build build: generate fmt vet ## Build manager binary. go build -o bin/manager main.go +.PHONY: run run: manifests generate fmt vet ## Run a controller from your host. go run ./main.go -docker-build: ## Build docker image with the manager. +.PHONY: docker-build +docker-build: test ## Build docker image with the manager. docker build -t ${IMG} . +.PHONY: docker-push docker-push: ## Push docker image with the manager. docker push ${IMG} -push-to-minikube: ## Add docker image with manager to minikube registry - minikube image load ${IMG} - -##@ Helm helpers - -CHARTS_DIR = $(shell pwd)/helm-charts - -CYELLOW=\033[1;33m -CEND=\033[0m -helm-warn: - @echo -e "$(CYELLOW)WARN$(CEND): After building, the manifests will be in:" - @echo -e "*~*~* $(CHARTS_DIR)/tarantool-operator/.templates.*/" - @echo -e "*~*~* but $(CYELLOW)this is not a helm template yet and they need to be migrated to templates.$(CEND)" - @echo - -helm-prepare-crds: manifests generate kustomize ## Build crds manifests for the helm chart using Kustomize. - @mkdir -p $(CHARTS_DIR)/tarantool-operator/crds/ - $(KUSTOMIZE) build config/crd -o $(CHARTS_DIR)/tarantool-operator/crds/ +##@ Deployment -helm-prepare-manager: helm-warn manifests generate kustomize ## Build manager manifests for the helm chart using Kustomize. - @mkdir -p $(CHARTS_DIR)/tarantool-operator/.templates.manager/ - $(KUSTOMIZE) build config/manager -o $(CHARTS_DIR)/tarantool-operator/.templates.manager/ +ifndef ignore-not-found + ignore-not-found = false +endif -helm-prepare-rbac: helm-warn manifests generate kustomize ## Build rbac manifests for the helm chart using Kustomize. - @mkdir -p $(CHARTS_DIR)/tarantool-operator/.templates.rbac/ - $(KUSTOMIZE) build config/rbac -o $(CHARTS_DIR)/tarantool-operator/.templates.rbac/ +.PHONY: install +install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. + $(KUSTOMIZE) build config/crd | kubectl apply -f - -helm-prepare-clear: ## Clear temp files builded using Kustomize. - rm -rf $(CHARTS_DIR)/tarantool-operator/.templates.*/ +.PHONY: uninstall +uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. + $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - -helm-install-operator: ## Install tarantool-operator with tarantool-operator helm chart. - helm upgrade --install -n tarantool-operator operator $(CHARTS_DIR)/tarantool-operator \ - --create-namespace \ - --set image.repository=$(REPO) \ - --set image.tag=$(VERSION) +.PHONY: deploy +deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + $(KUSTOMIZE) build config/default | kubectl apply -f - -helm-uninstall-operator: ## Uninstall tarantool-operator. - helm uninstall -n tarantool-operator operator +.PHONY: undeploy +undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. + $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - -helm-install-cartridge-app: ## Install cartridge-app with tarantool-cartridge helm chart. - helm upgrade --install -n tarantool-app cartridge-app $(CHARTS_DIR)/tarantool-cartridge \ - --create-namespace \ - --set LuaMemoryReserveMB=0 # default reserve too large for local minikube cluster +##@ Build Dependencies -helm-uninstall-cartridge-app: ## Uninstall cartridge-app. - helm uninstall -n tarantool-app cartridge-app +## Location to install dependencies to +LOCALBIN ?= $(shell pwd)/bin +$(LOCALBIN): + mkdir -p $(LOCALBIN) -##@ Deployment +## Tool Binaries +KUSTOMIZE ?= $(LOCALBIN)/kustomize +CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen +ENVTEST ?= $(LOCALBIN)/setup-envtest -install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl apply -f - +## Tool Versions +KUSTOMIZE_VERSION ?= v3.8.7 +CONTROLLER_TOOLS_VERSION ?= v0.10.0 -uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl delete -f - +KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" +.PHONY: kustomize +kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. +$(KUSTOMIZE): $(LOCALBIN) + test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); } -deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - $(KUSTOMIZE) build config/default | kubectl apply -f - +.PHONY: controller-gen +controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. +$(CONTROLLER_GEN): $(LOCALBIN) + test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) -undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/default | kubectl delete -f - - - -CONTROLLER_GEN = $(shell pwd)/bin/controller-gen -controller-gen: ## Download controller-gen locally if necessary. - $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,v0.7.0) - -KUSTOMIZE = $(shell pwd)/bin/kustomize -kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3,v3.10.0) - -# go-get-tool will 'go get' any package $2 in version $3 and install it to $1. -PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -define go-get-tool -@[ -f $(1) ] || { \ -set -e ;\ -TMP_DIR=$$(mktemp -d) ;\ -cd $$TMP_DIR ;\ -go mod init tmp ;\ -echo "Downloading $(2)@$(3)" ;\ -GO_VERSION=`go version | { read _ _ v _; echo $${v#go}; }` ; \ -GOBIN=$(PROJECT_DIR)/bin go get $(2)@$(3) ; \ -echo "Go version is $$GO_VERSION" ; \ -(printf '%s\n%s\n' "1.18" $$GO_VERSION | sort --check=quiet --version-sort) && GOBIN=$(PROJECT_DIR)/bin go install $(2) ; \ -rm -rf $$TMP_DIR ;\ -} -endef +.PHONY: envtest +envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. +$(ENVTEST): $(LOCALBIN) + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest .PHONY: bundle bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files. operator-sdk generate kustomize manifests -q cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) - $(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) + $(KUSTOMIZE) build config/manifests | operator-sdk generate bundle $(BUNDLE_GEN_FLAGS) operator-sdk bundle validate ./bundle .PHONY: bundle-build @@ -247,7 +208,7 @@ ifeq (,$(shell which opm 2>/dev/null)) set -e ;\ mkdir -p $(dir $(OPM)) ;\ OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.15.1/$${OS}-$${ARCH}-opm ;\ + curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\ chmod +x $(OPM) ;\ } else @@ -278,3 +239,19 @@ catalog-build: opm ## Build a catalog image. .PHONY: catalog-push catalog-push: ## Push a catalog image. $(MAKE) docker-push IMG=$(CATALOG_IMG) + +# Kustomize +KUSTOMIZE_DIR = $(shell pwd)/.kustomize +kustomize-warn: + @echo -e "$(CYELLOW)WARN$(CEND): After building, the manifests will be in:" + @echo -e "*~*~* $(KUSTOMIZE_DIR)" + @echo -e "*~*~* but $(CYELLOW)this is not a helm template yet and they need to be migrated to helm-charts.$(CEND)" + @echo + +kustomize-crds: kustomize-warn manifests generate kustomize ## Build rbac manifests for the helm chart using Kustomize. + @mkdir -p $(KUSTOMIZE_DIR)/crds/ + $(KUSTOMIZE) build config/crd -o $(KUSTOMIZE_DIR)/crds/ + +kustomize-rbac: kustomize-warn manifests generate kustomize ## Build rbac manifests for the helm chart using Kustomize. + @mkdir -p $(KUSTOMIZE_DIR)/rbac/ + $(KUSTOMIZE) build config/rbac -o $(KUSTOMIZE_DIR)/rbac/ \ No newline at end of file diff --git a/PROJECT b/PROJECT index d5eab1e0..d137ddc0 100644 --- a/PROJECT +++ b/PROJECT @@ -1,6 +1,7 @@ domain: tarantool.io layout: -- go.kubebuilder.io/v3 + - go.kubebuilder.io/v3 +multigroup: true plugins: manifests.sdk.operatorframework.io/v2: {} scorecard.sdk.operatorframework.io/v2: {} @@ -34,4 +35,34 @@ resources: kind: Role path: github.com/tarantool/tarantool-operator/api/v1alpha1 version: v1alpha1 +- api: + crdVersion: v1 + namespaced: true + domain: tarantool.io + kind: Cluster + path: github.com/tarantool/tarantool-operator/apis/v1beta1 + version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + domain: tarantool.io + kind: Role + path: github.com/tarantool/tarantool-operator/apis/v1beta1 + version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: tarantool.io + kind: FailoverConfig + path: github.com/tarantool/tarantool-operator/apis/v1beta1 + version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: tarantool.io + kind: CartridgeConfig + path: github.com/tarantool/tarantool-operator/apis/v1beta1 + version: v1beta1 version: "3" diff --git a/README.md b/README.md index 00b46dcd..c5e1e831 100644 --- a/README.md +++ b/README.md @@ -1,292 +1,49 @@ - + -# Tarantool Kubernetes operator +# Tarantool Kubernetes Operator CE -[![Test][gh-actions-badge]][gh-actions-url] +[![Tests][gh-test-actions-badge]][gh-actions-url] +[![Lint][gh-lint-actions-badge]][gh-actions-url] -The Tarantool Operator provides automation that simplifies the administration -of [Tarantool Cartridge](https://github.com/tarantool/cartridge)-based cluster on Kubernetes. +This is a [Kubernetes Operator](https://coreos.com/operators/) which deploys [Tarantool Cartridge](https://github.com/tarantool/cartridge)-based +cluster on Kubernetes. -The Operator introduces new API version `tarantool.io/v1alpha1` and installs -custom resources for objects of three custom types: Cluster, Role, and -ReplicasetTemplate. +If you are a Tarantool Enterprise customer, or need Enterprise features such as rolling update, scaling down and may others +you can use the [Tarantool Operator Enterprise](https://www.tarantool.io/ru/kubernetesoperator). -## Table of contents - -* [Resources](#resources) -* [Resource ownership](#resource-ownership) -* [Documentation](#documentation) -* [Deploying the Tarantool operator on minikube](#deploying-the-tarantool-operator-on-minikube) -* [Example: key-value storage](#example-application-key-value-storage) - * [Application topology](#application-topology) - * [Running the application](#running-the-application) - * [Scaling the application](#scaling-the-application) - * [Running tests](#running-tests) +## IMPORTANT NOTICE -## Resources +Begins from v1.0.0-rc1 Tarantool Kubernetes Operator CE was completely rewrote. -**Cluster** represents a single Tarantool Cartridge cluster. +API version was bumped and any backward compatibility was dropped. -**Role** represents a Tarantool Cartridge user role. +There is only one approved method to migrate from version 0.0.0 to versions >=1.0.0-rc1, +please follow [migration guide](./docs/migrate-from-0.0.x-to-1.0.0.md). -**ReplicasetTemplate** is a template for StatefulSets created as members of Role. - -## Resource ownership +## Table of contents -Resources managed by the Operator being deployed have the following resource -ownership hierarchy: +* [Getting started](#getting-started) +* [Documentation](#documentation) +* [Contribute](#contribute) -![Resource ownership](./assets/resource_map.png) +## Getting started -Resource ownership directly affects how Kubernetes garbage collector works. -If you execute a delete command on a parent resource, then all its dependants -will be removed. +- [Install the Operator](./docs/installation.md) +- [Deploy example application](./docs/deploy-example-application.md) ## Documentation -The documentation is on the Tarantool official [website](https://www.tarantool.io/ru/doc/latest/book/cartridge/cartridge_kubernetes_guide/). - - -## Deploying the Tarantool operator on minikube - -1. Install the required deployment utilities: - - * [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - * [helm](https://helm.sh/docs/intro/install/) - - Pick one of these to run a local kubernetes cluster - * [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) - * [Windows Docker Desktop](https://docs.docker.com/docker-for-windows/#kubernetes) - * [OSX Docker Desktop](https://docs.docker.com/docker-for-mac/#kubernetes) - - To install and configure a local minikube installation: - - Create a `minikube` cluster: - - ```shell - $ minikube start --memory=4096 - ``` - - You will need 4Gb of RAM allocated to the `minikube` cluster to run examples. - - Ensure `minikube` is up and running: - - ```shell - $ minikube status - --- - minikube - type: Control Plane - host: Running - kubelet: Running - apiserver: Running - kubeconfig: Configured - ``` - -2. Build the operator image - - ```shell - $ make docker-build - ``` - - By default, the image is tagged as `tarantool-operator:` - -3. Add image to local minikube registry - - ```shell - $ make push-to-minikube - --- - minikube image load tarantool-operator:0.0.9 - ``` - -> **NOTE**: If you want to use the [official docker image](https://hub.docker.com/r/tarantool/tarantool-operator/tags) of the Tarantool operator use the **helm charts from the tarantool helm repository**. -> Read more about this in the [documentation](https://www.tarantool.io/ru/doc/latest/book/cartridge/cartridge_kubernetes_guide/#launch-the-application). - -4. Install the operator - - ```shell - $ helm install -n tarantool-operator operator helm-charts/tarantool-operator \ - --create-namespace \ - --set image.repository=tarantool-operator \ - --set image.tag=0.0.9 - --- - NAME: operator - LAST DEPLOYED: Wed Dec 15 22:54:13 2021 - NAMESPACE: tarantool-operator - STATUS: deployed - REVISION: 1 - TEST SUITE: None - ``` - - Or you can use make: - - ```shell - $ make helm-install-operator - ``` - - Ensure the operator is up: - - ```shell - $ kubectl get pods -n tarantool-operator - --- - NAME READY STATUS RESTARTS AGE - controller-manager-778db958cf-bhw6z 1/1 Running 0 77s - ``` - - Wait for `controller-manager-xxxxxx-xx` Pod's status to become `Running`. - -## Example Application: key-value storage - -`examples/kv` contains a Tarantool-based distributed key-value storage. -Data are accessed via HTTP REST API. - -### Application topology - -![App topology](./examples/kv/assets/topology.png) - -### Running the application - -We assume that commands are executed from the repository root and -Tarantool Operator is up and running. - -1. Create a cluster: - - ```shell - $ helm install -n tarantool-app cartridge-app helm-charts/tarantool-cartridge \ - --create-namespace \ - --set LuaMemoryReserveMB=256 - --- - NAME: cartridge-app - LAST DEPLOYED: Wed Dec 15 23:50:09 2021 - NAMESPACE: tarantool-app - STATUS: deployed - REVISION: 1 - ``` - - Or you can use make: - - ```shell - $ make helm-install-cartridge-app - ``` - - Wait until all the cluster Pods are up (status becomes `Running`): - - ```shell - $ kubectl -n tarantool-app get pods - --- - NAME READY STATUS RESTARTS AGE - routers-0-0 1/1 Running 0 6m12s - storage-0-0 1/1 Running 0 6m12s - storage-0-1 1/1 Running 0 6m12s - ``` - -2. Ensure cluster became operational: - - ```shell - $ kubectl -n tarantool-app describe clusters.tarantool.io/tarantool-cluster - ``` - - wait until Status.State is Ready: - - ```shell - ... - Status: - State: Ready - ... - ``` - -3. Access the cluster web UI: - - ```shell - $ kubectl -n tarantool-app port-forward routers-0-0 8081:8081 - --- - Forwarding from 127.0.0.1:8081 -> 8081 - Forwarding from [::1]:8081 -> 8081 - Handling connection for 8081 - ```` - -4. Access the key-value API: - - 1. Store some value: - - ```shell - $ curl -XPOST http://localhost:8081/kv -d '{"key":"key_1", "value": "value_1"}' - --- - {"info":"Successfully created"} - ``` - - 2. Access stored value: - - ```shell - $ curl http://localhost:8081/kv/key_1 - --- - "value_1" - ``` - - 3. Update stored value: - - ```shell - $ curl -XPUT http://localhost:8081/kv/key_1 -d '"new_value_1"' - --- - ["key_1", "new_value_1"] - ``` - - 4. Delete stored value: - - ```shell - $ curl -XDELETE http://localhost:8081/kv/key_1 - --- - {"info":"Successfully deleted"} - ``` - -### Scaling the application - -Increase the number of replica sets in Storages Role: - -In the cartridge helm chart, edit the `helm-charts/tarantool-cartridge/values.yaml` file to be - -```yaml -- RoleName: storage - ReplicaCount: 2 - ReplicaSetCount: 2 -``` - -Then run: - -```shell -$ helm upgrade -n tarantool-app cartridge-app helm-charts/tarantool-cartridge \ - --set LuaMemoryReserveMB=256 -``` - -This will add another storage role replica set to the existing cluster. View the new cluster topology via the cluster web UI. - -Read more about cluster management in the [documentation](https://www.tarantool.io/ru/doc/latest/book/cartridge/cartridge_kubernetes_guide/#cluster-management). - -## Development - -Use `make help` to describe all targets. - -Below are some of them. - -### Regenerate the Custom Resource Definitions - -```shell -$ make manifests -``` - -### Building tarantool-operator docker image +The documentation is work in progress... -```shell -$ make docker-build -``` +At the moment you can use official [helm-chart](https://github.com/tarantool/helm-charts/tree/master/charts/tarantool-operator) +and receive useful information from comments in default [values.yaml](https://github.com/tarantool/helm-charts/blob/master/charts/tarantool-operator/values.yaml) file -### Running tests +## Contribute -```shell -$ make test -``` +Please follow the [development guide](./docs/development-guide.md) -[gh-actions-badge]: https://github.com/tarantool/tarantool-operator/workflows/Test/badge.svg +[gh-lint-actions-badge]: https://github.com/tarantool/tarantool-operator/actions/workflows/lint.yml/badge.svg +[gh-test-actions-badge]: https://github.com/tarantool/tarantool-operator/actions/workflows/test.yml/badge.svg [gh-actions-url]: https://github.com/tarantool/tarantool-operator/actions diff --git a/api/v1alpha1/cluster_types.go b/apis/v1alpha1/cluster_types.go similarity index 95% rename from api/v1alpha1/cluster_types.go rename to apis/v1alpha1/cluster_types.go index c9e024f4..5fa43af6 100644 --- a/api/v1alpha1/cluster_types.go +++ b/apis/v1alpha1/cluster_types.go @@ -56,10 +56,11 @@ type ClusterStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Cluster is the Schema for the clusters API -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",priority=0 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:unservedversion type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -70,7 +71,7 @@ type Cluster struct { //+kubebuilder:object:root=true -// ClusterList contains a list of Cluster +// ClusterList contains a list of Cluster. type ClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/groupversion_info.go b/apis/v1alpha1/groupversion_info.go similarity index 96% rename from api/v1alpha1/groupversion_info.go rename to apis/v1alpha1/groupversion_info.go index 53863721..c0025094 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/apis/v1alpha1/groupversion_info.go @@ -27,8 +27,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Package v1alpha1 contains API Schema definitions for the tarantool.io v1alpha1 API group -//+kubebuilder:object:generate=true -//+groupName=tarantool.io +// +kubebuilder:object:generate=true +// +groupName=tarantool.io package v1alpha1 import ( @@ -37,10 +37,10 @@ import ( ) var ( - // GroupVersion is group version used to register these objects + // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: "tarantool.io", Version: "v1alpha1"} - // SchemeBuilder is used to add go types to the GroupVersionKind scheme + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. diff --git a/api/v1alpha1/replicasettemplate_types.go b/apis/v1alpha1/replicasettemplate_types.go similarity index 93% rename from api/v1alpha1/replicasettemplate_types.go rename to apis/v1alpha1/replicasettemplate_types.go index 0f00a839..3e4a6ee1 100644 --- a/api/v1alpha1/replicasettemplate_types.go +++ b/apis/v1alpha1/replicasettemplate_types.go @@ -36,22 +36,22 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -// ReplicasetTemplateSpec defines the desired state of ReplicasetTemplate +// ReplicasetTemplateSpec defines the desired state of ReplicasetTemplate. type ReplicasetTemplateSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file } -// ReplicasetTemplateStatus defines the observed state of ReplicasetTemplate +// ReplicasetTemplateStatus defines the observed state of ReplicasetTemplate. type ReplicasetTemplateStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file } -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - // ReplicasetTemplate is the Schema for the replicasettemplates API +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion type ReplicasetTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -62,7 +62,7 @@ type ReplicasetTemplate struct { //+kubebuilder:object:root=true -// ReplicasetTemplateList contains a list of ReplicasetTemplate +// ReplicasetTemplateList contains a list of ReplicasetTemplate. type ReplicasetTemplateList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/role_types.go b/apis/v1alpha1/role_types.go similarity index 92% rename from api/v1alpha1/role_types.go rename to apis/v1alpha1/role_types.go index 75003162..442d8659 100644 --- a/api/v1alpha1/role_types.go +++ b/apis/v1alpha1/role_types.go @@ -35,7 +35,7 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -// RoleSpec defines the desired state of Role +// RoleSpec defines the desired state of Role. type RoleSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file @@ -47,16 +47,16 @@ type RoleSpec struct { Selector *metav1.LabelSelector `json:"selector,omitempty"` } -// RoleStatus defines the observed state of Role +// RoleStatus defines the observed state of Role. type RoleStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file } -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - // Role is the Schema for the roles API +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:unservedversion type Role struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -67,7 +67,7 @@ type Role struct { //+kubebuilder:object:root=true -// RoleList contains a list of Role +// RoleList contains a list of Role. type RoleList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go similarity index 86% rename from api/v1alpha1/zz_generated.deepcopy.go rename to apis/v1alpha1/zz_generated.deepcopy.go index 8a185a95..d176e3f4 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -2,31 +2,35 @@ // +build !ignore_autogenerated /* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2022 Tarantool AUTHORS: please see AUTHORS file. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY AUTHORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + */ // Code generated by controller-gen. DO NOT EDIT. diff --git a/apis/v1beta1/cartridgeconfig_types.go b/apis/v1beta1/cartridgeconfig_types.go new file mode 100644 index 00000000..a6bc82de --- /dev/null +++ b/apis/v1beta1/cartridgeconfig_types.go @@ -0,0 +1,74 @@ +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CartridgeConfigSpec defines the desired state of CartridgeConfig. +type CartridgeConfigSpec struct { + // Data contains the configuration data. + // +kubebuilder:validation:Required + Data string `json:"data,omitempty"` +} + +// CartridgeConfigPhase is a label for the condition of a CartridgeConfig at the current time. +// +enum. +type CartridgeConfigPhase string + +const ( + CartridgeConfigWaitingForCluster CartridgeConfigPhase = "WaitingForCluster" + CartridgeConfigWaitingForLeader CartridgeConfigPhase = "WaitingForLeader" + CartridgeConfigApplying CartridgeConfigPhase = "Applying" + CartridgeConfigReady CartridgeConfigPhase = "Ready" +) + +// CartridgeConfigStatus defines the observed state of CartridgeConfig. +type CartridgeConfigStatus struct { + // Phase indicates current state of CartridgeConfig + // +kubebuilder:default=Pending + Phase CartridgeConfigPhase `json:"phase"` +} + +// CartridgeConfig is the Schema for the cartridgeconfigs API +// More info: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_api/modules/cartridge.clusterwide-config/ +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",priority=0 +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type CartridgeConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec CartridgeConfigSpec `json:"spec,omitempty"` + Status CartridgeConfigStatus `json:"status,omitempty"` +} + +func (in *CartridgeConfig) ResetStatus() { + in.Status = CartridgeConfigStatus{} +} + +func (in *CartridgeConfig) SetPhase(phase CartridgeConfigPhase) { + in.Status.Phase = phase +} + +func (in *CartridgeConfig) GetPhase() CartridgeConfigPhase { + return in.Status.Phase +} + +func (in *CartridgeConfig) GetData() []byte { + return []byte(in.Spec.Data) +} + +//+kubebuilder:object:root=true + +// CartridgeConfigList contains a list of CartridgeConfig. +type CartridgeConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CartridgeConfig `json:"items"` +} + +func init() { + SchemeBuilder.Register(&CartridgeConfig{}, &CartridgeConfigList{}) +} diff --git a/apis/v1beta1/cluster_types.go b/apis/v1beta1/cluster_types.go new file mode 100644 index 00000000..e49ab6f9 --- /dev/null +++ b/apis/v1beta1/cluster_types.go @@ -0,0 +1,283 @@ +package v1beta1 + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ClusterSpec defines the desired state of Cluster +// +k8s:openapi-gen=true +// +kubebuilder:printcolumn:name="Failover",type="string",JSONPath=".failover.mode",priority=0 +type ClusterSpec struct { + // Domain is kubernetes cluster domain, defaults to: "cluster.local". + // +kubebuilder:validation:Optional + // +kubebuilder:default=cluster.local + Domain string `json:"domain,omitempty"` + + // ListenPort is port where tarantool iproto starts + // +optional + // +kubebuilder:default=3301 + ListenPort int32 `json:"listenPort"` + + // Failover defines cartridge failover params + // More info: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_api/modules/cartridge/#failoverparams + Failover FailoverConfig `json:"failover"` + + // Failover defines foreign cartridge instance as topology leader + ForeignLeader string `json:"foreignLeader,omitempty"` +} + +// FailoverConfig defines cartridge failover params +// More info: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_api/modules/cartridge/#failoverparams +// +k8s:openapi-gen=true +type FailoverConfig struct { + // Mode is a string value which determinate Cartridge failover mode. Allowed value is one of disabled, eventual, stateful. + // More info: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_api/modules/cartridge/#automatic-failover-management + // +kubebuilder:validation:Enum=disabled;eventual;stateful;raft + // +kubebuilder:default=disabled + // +optional + Mode api.FailoverMode `json:"mode"` + + // Timeout (in seconds), used by membership tomark suspect members as dead (default: 20) + // +kubebuilder:default=20 + // +optional + Timeout int32 `json:"timeout"` + + // StateProvider - storage for failover state. Only «etcd2» supported at the moment. + // +kubebuilder:validation:Enum=etcd2;stateboard + // +optional + StateProvider api.FailoverStateProvider `json:"stateProvider"` + + // Fencing - Abandon leadership when both the state provider quorum and atleast one replica are lost (suitable in stateful mode only,default: false) + // +kubebuilder:default=false + // +optional + Fencing bool `json:"fencing"` + + // FencingTimeout - Time (in seconds) to actuate fencing after the check fails(default: 10) + // +kubebuilder:default=10 + // +optional + FencingTimeout int32 `json:"fencingTimeout"` + + // FencingPause - The period (in seconds) of performing the check(default: 2) + // +kubebuilder:default=2 + // +optional + FencingPause int32 `json:"fencingPause"` + + // Etcd2 is a config for "etcd2" failover state provider + // +optional + Etcd2 *FailoverEtcd2 `json:"etcd2"` + + // Stateboard is a config for "stateboard" failover state provider + // +optional + Stateboard *FailoverStateboard `json:"stateboard"` +} + +func (in *FailoverConfig) GetMode() api.FailoverMode { + return in.Mode +} + +func (in *FailoverConfig) GetTimeout() int32 { + return in.Timeout +} + +func (in *FailoverConfig) GetStateProvider() api.FailoverStateProvider { + return in.StateProvider +} + +func (in *FailoverConfig) GetFencing() bool { + return in.Fencing +} + +func (in *FailoverConfig) GetFencingTimeout() int32 { + return in.FencingTimeout +} + +func (in *FailoverConfig) GetFencingPause() int32 { + return in.FencingPause +} + +func (in *FailoverConfig) GetETCD2Config() api.FailoverETCD2Config { + return in.Etcd2 +} + +func (in *FailoverConfig) GetStateboardConfig() api.FailoverStateboardConfig { + return in.Stateboard +} + +// FailoverEtcd2 is a config for "etcd2" failover state provider +// +k8s:openapi-gen=true +type FailoverEtcd2 struct { + // Defines "etcd2" failover state provider params + // More info: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_api/modules/cartridge/#failoverparams + + // Endpoints - URIs that are used to discover and to access etcd cluster instances. + // +optional + Endpoints []string `json:"endpoints"` + + // Username for etcd2 connection + // +kubebuilder:validation:Required + Username string `json:"username"` + + // Password for etcd2 connection + // +optional + Password corev1.SecretReference `json:"password"` + + // LockDelay - Timeout (in seconds), determines lock’s time-to-live (default: 10) + // +kubebuilder:default=10 + // +optional + LockDelay int32 `json:"lockDelay"` + + // Prefix used for etcd keys: /lock and`/leaders`, defaults to empty string + // +optional + Prefix string `json:"prefix"` +} + +func (in *FailoverEtcd2) GetEndpoints() []string { + return in.Endpoints +} + +func (in *FailoverEtcd2) GetUsername() string { + return in.Username +} + +func (in *FailoverEtcd2) GetPassword() corev1.SecretReference { + return in.Password +} + +func (in *FailoverEtcd2) GetLockDelay() int32 { + return in.LockDelay +} + +func (in *FailoverEtcd2) GetPrefix() string { + return in.Prefix +} + +// FailoverStateboard is a config for "stateboard" failover state provider +// +k8s:openapi-gen=true +type FailoverStateboard struct { + // URI of stateboard + // +kubebuilder:validation:Required + URI string `json:"uril"` + + // Password for etcd2 connection + // +optional + Password corev1.SecretReference `json:"password"` +} + +func (in *FailoverStateboard) GetURI() string { + return in.URI +} + +func (in *FailoverStateboard) GetPassword() corev1.SecretReference { + return in.Password +} + +// ClusterPhase is a label for the condition of a Cluster at the current time. +// +enum. +type ClusterPhase string + +const ( + ClusterPending ClusterPhase = "Pending" + ClusterSyncingService ClusterPhase = "SyncingService" + ClusterWaitingForRoles ClusterPhase = "WaitingForRoles" + ClusterWaitingForLeader ClusterPhase = "WaitingForLeader" + ClusterReady ClusterPhase = "Ready" + ClusterUnableToBootstrap ClusterPhase = "UnableToBootstrap" + ClusterFailoverConfiguring ClusterPhase = "FailoverConfiguring" +) + +// ClusterStatus defines the observed state of Cluster +// +k8s:openapi-gen=true +type ClusterStatus struct { + // Phase indicates current state of cluster + // +kubebuilder:default=Pending + Phase ClusterPhase `json:"phase"` + + // Bootstrapped indicates that vshard was bootstrapped + // +kubebuilder:default=false + Bootstrapped bool `json:"bootstrapped"` + + // Leader indicates name of pod which use to control topology + // +optional + Leader string `json:"leader"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Cluster is the Schema for the clusters API +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",priority=0 +// +kubebuilder:printcolumn:name="Leader",type="string",JSONPath=".status.leader",priority=0 +// +kubebuilder:printcolumn:name="Bootstrapped",type="boolean",JSONPath=".status.bootstrapped",priority=0 +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type Cluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ClusterSpec `json:"spec,omitempty"` + Status ClusterStatus `json:"status,omitempty"` +} + +func (in *Cluster) GetDomain() string { + return in.Spec.Domain +} + +func (in *Cluster) GetListenPort() int32 { + return in.Spec.ListenPort +} + +func (in *Cluster) GetFailoverConfig() api.FailoverConfig { + return &in.Spec.Failover +} + +func (in *Cluster) SetLeader(leader string) { + in.Status.Leader = leader +} + +func (in *Cluster) GetLeader() string { + if in.Spec.ForeignLeader != "" { + return in.Spec.ForeignLeader + } + + return in.Status.Leader +} + +func (in *Cluster) MarkBootstrapped() { + in.Status.Bootstrapped = true +} + +func (in *Cluster) IsBootstrapped() bool { + return in.Status.Bootstrapped +} + +func (in *Cluster) ResetStatus() { + in.Status = ClusterStatus{ + Phase: "", + Bootstrapped: in.Status.Bootstrapped, + Leader: in.Status.Leader, + } +} + +func (in *Cluster) SetPhase(phase ClusterPhase) { + in.Status.Phase = phase +} + +func (in *Cluster) GetPhase() ClusterPhase { + return in.Status.Phase +} + +//+kubebuilder:object:root=true + +// ClusterList contains a list of Cluster. +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Cluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Cluster{}, &ClusterList{}) +} diff --git a/apis/v1beta1/groupversion_info.go b/apis/v1beta1/groupversion_info.go new file mode 100644 index 00000000..e9c49a53 --- /dev/null +++ b/apis/v1beta1/groupversion_info.go @@ -0,0 +1,20 @@ +// Package v1beta1 contains API Schema definitions for the v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=tarantool.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "tarantool.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/v1beta1/role_types.go b/apis/v1beta1/role_types.go new file mode 100644 index 00000000..4b3b219b --- /dev/null +++ b/apis/v1beta1/role_types.go @@ -0,0 +1,196 @@ +package v1beta1 + +import ( + "fmt" + + "github.com/tarantool/tarantool-operator/pkg/api" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// RoleSpec defines the desired state of Role. +type RoleSpec struct { + // Replicasets is a number of StatefulSets (Tarantool replicasets) created under this Role, defaults to 1 + // +optional + // +kubebuilder:default=1 + Replicasets *int32 `json:"replicasets"` + + // ReplicasetTemplate is the object that describes the StatefulSet that will be created if + // insufficient Replicasets are detected. Each StatefulSet stamped out by the Role + // will fulfill this ReplicasetTemplate, but have a unique identity from the rest + // of the Role. + ReplicasetTemplate *ReplicasetTemplate `json:"replicasetTemplate"` + + // AllRw is a flag indicating that all servers in the replicaset should be read-write. + // +optional + AllRw bool `json:"allRw"` + + // VShard defines config for vshard + // See more: https://www.tarantool.io/doc/latest/reference/reference_rock/vshard/ + // +kubebuilder:validation:Required + VShard RoleVShardConfig `json:"vshard"` +} + +// ReplicasetTemplate is StatefulSet.Spec but with some fields omit +// +k8s:openapi-gen=true +type ReplicasetTemplate struct { + // Replicas is the desired number of replicas of the given PodTemplate. + // These are replicas in the sense that they are instantiations of the + // same PodTemplate, but individual replicas also have a consistent identity. + // If unspecified, defaults to 1. + // +optional + // +kubebuilder:default=1 + Replicas *int32 `json:"replicas,omitempty"` + + // PodTemplate is the object that describes the pod that will be created if + // insufficient replicas are detected. Each pod stamped out by the StatefulSet + // will fulfill this PodTemplate, but have a unique identity from the rest + // of the StatefulSet. + // +kubebuilder:validation:Required + PodTemplate v1.PodTemplateSpec `json:"podTemplate,omitempty"` + + // VolumeClaimTemplates is a list of claims that pods are allowed to reference. + // The StatefulSet controller is responsible for mapping network identities to + // claims in a way that maintains the identity of a pod. Every claim in + // this list must have at least one matching (by name) volumeMount in one + // container in the template. A claim in this list takes precedence over + // any volumes in the template, with the same name. + // +optional + VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` + + // MinReadySeconds is a minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + // +kubebuilder:default=0 + MinReadySeconds int32 `json:"minReadySeconds,omitempty"` +} + +// RoleVShardConfig defines config for vshard +// See more: https://www.tarantool.io/doc/latest/reference/reference_rock/vshard/ +// +k8s:openapi-gen=true +type RoleVShardConfig struct { + // VshardGroupName defines group for ReplicaSet with `vshard-storage` role, defaults to: "default" + // Seem more: https://www.tarantool.io/doc/latest/book/cartridge/cartridge_dev/#using-multiple-vshard-storage-groups + // +optional + // +kubebuilder:default=default + VshardGroupName string `json:"vshardGroupName,omitempty"` + + // roles https://www.tarantool.io/ru/doc/latest/book/cartridge/cartridge_dev/#cluster-roles + // +kubebuilder:validation:Required + ClusterRoles []string `json:"clusterRoles"` + + // Weight is a number which determinate vshard weight of each replicaset in role, defaults to 100 + // See more: https://www.tarantool.io/ru/doc/latest/reference/reference_rock/vshard/vshard_admin/#replica-weights + // +optional + // +kubebuilder:default=100 + Weight int32 `json:"weight,omitempty"` +} + +func (in *RoleVShardConfig) GetGroupName() string { + return in.VshardGroupName +} + +func (in *RoleVShardConfig) GetRoles() []string { + return in.ClusterRoles +} + +func (in *RoleVShardConfig) GetWeight() int32 { + return in.Weight +} + +// RolePhase is a label for the condition of a role at the current time. +// +enum. +type RolePhase string + +// These are the valid statuses of Role. +const ( + RolePending RolePhase = "Pending" + RoleWaitingForCluster RolePhase = "WaitingForCluster" + RoleWaitingForLeader RolePhase = "WaitingForLeader" + RoleWaitForCartridgeReady RolePhase = "WaitForCartridgeReady" + RoleJoining RolePhase = "Joining" + RoleConfiguring RolePhase = "Configuring" + RoleWaitingForBootstrap RolePhase = "WaitingForBootstrap" + RoleConfiguringWeights RolePhase = "ConfiguringWeights" + RoleReady RolePhase = "Ready" + RoleConfigError RolePhase = "ConfigError" +) + +// RoleStatus defines the observed state of Role +// +k8s:openapi-gen=true +type RoleStatus struct { + // Phase of roles + // +kubebuilder:default=Pending + Phase RolePhase `json:"phase"` +} + +// Role is the Schema for the roles API +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",priority=0 +// +kubebuilder:printcolumn:name="Replicasets",type="number",JSONPath=".status.replicasets",priority=1 +// +kubebuilder:printcolumn:name="Ready replicasets",type="number",JSONPath=".status.readyReplicasets",priority=1 +// +kubebuilder:printcolumn:name="Replicas",type="number",JSONPath=".status.replicas",priority=1 +// +kubebuilder:printcolumn:name="Ready replicas",type="number",JSONPath=".status.readyReplicas",priority=1 +// +kubebuilder:printcolumn:name="Weight",type="number",JSONPath=".status.weight",priority=0 +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",priority=0 +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type Role struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec RoleSpec `json:"spec,omitempty"` + Status RoleStatus `json:"status,omitempty"` +} + +func (in *Role) IsAllRw() bool { + return in.Spec.AllRw +} + +func (in *Role) GetReplicasetName(ordinal int32) (string, error) { + return fmt.Sprintf("%s-%d", in.Name, ordinal), nil +} + +func (in *Role) GetReplicasets() int32 { + return *in.Spec.Replicasets +} + +func (in *Role) GetReplicas() int32 { + return *in.Spec.ReplicasetTemplate.Replicas +} + +func (in *Role) GetVolumeClaimTemplates() []v1.PersistentVolumeClaim { + return in.Spec.ReplicasetTemplate.VolumeClaimTemplates +} + +func (in *Role) ResetStatus() { + in.Status = RoleStatus{} +} + +func (in *Role) SetPhase(phase RolePhase) { + in.Status.Phase = phase +} + +func (in *Role) GetPhase() RolePhase { + return in.Status.Phase +} + +func (in *Role) GetVShardConfig() api.VShardConfig { + return &in.Spec.VShard +} + +// RoleList contains a list of Role +// +kubebuilder:object:root=true +type RoleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Role `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Role{}, &RoleList{}) +} diff --git a/apis/v1beta1/zz_generated.deepcopy.go b/apis/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 00000000..9f2292b6 --- /dev/null +++ b/apis/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,432 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Tarantool AUTHORS: please see AUTHORS file. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY AUTHORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CartridgeConfig) DeepCopyInto(out *CartridgeConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CartridgeConfig. +func (in *CartridgeConfig) DeepCopy() *CartridgeConfig { + if in == nil { + return nil + } + out := new(CartridgeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CartridgeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CartridgeConfigList) DeepCopyInto(out *CartridgeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CartridgeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CartridgeConfigList. +func (in *CartridgeConfigList) DeepCopy() *CartridgeConfigList { + if in == nil { + return nil + } + out := new(CartridgeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CartridgeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CartridgeConfigSpec) DeepCopyInto(out *CartridgeConfigSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CartridgeConfigSpec. +func (in *CartridgeConfigSpec) DeepCopy() *CartridgeConfigSpec { + if in == nil { + return nil + } + out := new(CartridgeConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CartridgeConfigStatus) DeepCopyInto(out *CartridgeConfigStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CartridgeConfigStatus. +func (in *CartridgeConfigStatus) DeepCopy() *CartridgeConfigStatus { + if in == nil { + return nil + } + out := new(CartridgeConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *out = *in + in.Failover.DeepCopyInto(&out.Failover) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailoverConfig) DeepCopyInto(out *FailoverConfig) { + *out = *in + if in.Etcd2 != nil { + in, out := &in.Etcd2, &out.Etcd2 + *out = new(FailoverEtcd2) + (*in).DeepCopyInto(*out) + } + if in.Stateboard != nil { + in, out := &in.Stateboard, &out.Stateboard + *out = new(FailoverStateboard) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverConfig. +func (in *FailoverConfig) DeepCopy() *FailoverConfig { + if in == nil { + return nil + } + out := new(FailoverConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailoverEtcd2) DeepCopyInto(out *FailoverEtcd2) { + *out = *in + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Password = in.Password +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverEtcd2. +func (in *FailoverEtcd2) DeepCopy() *FailoverEtcd2 { + if in == nil { + return nil + } + out := new(FailoverEtcd2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailoverStateboard) DeepCopyInto(out *FailoverStateboard) { + *out = *in + out.Password = in.Password +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverStateboard. +func (in *FailoverStateboard) DeepCopy() *FailoverStateboard { + if in == nil { + return nil + } + out := new(FailoverStateboard) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicasetTemplate) DeepCopyInto(out *ReplicasetTemplate) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.PodTemplate.DeepCopyInto(&out.PodTemplate) + if in.VolumeClaimTemplates != nil { + in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates + *out = make([]v1.PersistentVolumeClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicasetTemplate. +func (in *ReplicasetTemplate) DeepCopy() *ReplicasetTemplate { + if in == nil { + return nil + } + out := new(ReplicasetTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Role) DeepCopyInto(out *Role) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Role. +func (in *Role) DeepCopy() *Role { + if in == nil { + return nil + } + out := new(Role) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Role) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleList) DeepCopyInto(out *RoleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Role, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleList. +func (in *RoleList) DeepCopy() *RoleList { + if in == nil { + return nil + } + out := new(RoleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RoleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleSpec) DeepCopyInto(out *RoleSpec) { + *out = *in + if in.Replicasets != nil { + in, out := &in.Replicasets, &out.Replicasets + *out = new(int32) + **out = **in + } + if in.ReplicasetTemplate != nil { + in, out := &in.ReplicasetTemplate, &out.ReplicasetTemplate + *out = new(ReplicasetTemplate) + (*in).DeepCopyInto(*out) + } + in.VShard.DeepCopyInto(&out.VShard) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleSpec. +func (in *RoleSpec) DeepCopy() *RoleSpec { + if in == nil { + return nil + } + out := new(RoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleStatus) DeepCopyInto(out *RoleStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleStatus. +func (in *RoleStatus) DeepCopy() *RoleStatus { + if in == nil { + return nil + } + out := new(RoleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleVShardConfig) DeepCopyInto(out *RoleVShardConfig) { + *out = *in + if in.ClusterRoles != nil { + in, out := &in.ClusterRoles, &out.ClusterRoles + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleVShardConfig. +func (in *RoleVShardConfig) DeepCopy() *RoleVShardConfig { + if in == nil { + return nil + } + out := new(RoleVShardConfig) + in.DeepCopyInto(out) + return out +} diff --git a/assets/kv_web_ui.png b/assets/kv_web_ui.png deleted file mode 100644 index cc8bc2b9..00000000 Binary files a/assets/kv_web_ui.png and /dev/null differ diff --git a/assets/resource_map.png b/assets/resource_map.png deleted file mode 100644 index 8ecb6aea..00000000 Binary files a/assets/resource_map.png and /dev/null differ diff --git a/config/crd/bases/tarantool.io_cartridgeconfigs.yaml b/config/crd/bases/tarantool.io_cartridgeconfigs.yaml new file mode 100644 index 00000000..5edfc753 --- /dev/null +++ b/config/crd/bases/tarantool.io_cartridgeconfigs.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: cartridgeconfigs.tarantool.io +spec: + group: tarantool.io + names: + kind: CartridgeConfig + listKind: CartridgeConfigList + plural: cartridgeconfigs + singular: cartridgeconfig + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + data: + type: string + type: object + status: + properties: + phase: + default: Pending + type: string + required: + - phase + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/tarantool.io_clusters.yaml b/config/crd/bases/tarantool.io_clusters.yaml index e24325ef..2d9c6052 100644 --- a/config/crd/bases/tarantool.io_clusters.yaml +++ b/config/crd/bases/tarantool.io_clusters.yaml @@ -1,10 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.10.0 creationTimestamp: null name: clusters.tarantool.io spec: @@ -26,52 +25,25 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: Cluster is the Schema for the clusters API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: - description: ClusterSpec defines the desired state of Cluster properties: selector: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - Important: Run "operator-sdk generate k8s" to regenerate code after - modifying this file Add custom validation using kubebuilder tags: - https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector requirement is a selector that - contains values, a key, and an operator that relates the key - and values. properties: key: - description: key is the label key that the selector applies - to. type: string operator: - description: operator represents a key's relationship to - a set of values. Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of string values. If the - operator is In or NotIn, the values array must be non-empty. - If the operator is Exists or DoesNotExist, the values - array must be empty. This array is replaced during a strategic - merge patch. items: type: string type: array @@ -83,32 +55,144 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single - {key,value} in the matchLabels map is equivalent to an element - of matchExpressions, whose key field is "key", the operator - is "In", and the values array contains only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic type: object status: - description: ClusterStatus defines the observed state of Cluster properties: state: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "operator-sdk generate k8s" to regenerate - code after modifying this file Add custom validation using kubebuilder - tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' type: string type: object type: object + served: false + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .status.leader + name: Leader + type: string + - jsonPath: .status.bootstrapped + name: Bootstrapped + type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + domain: + default: cluster.local + type: string + failover: + properties: + etcd2: + properties: + endpoints: + items: + type: string + type: array + lockDelay: + default: 10 + format: int32 + type: integer + password: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + username: + type: string + required: + - username + type: object + fencing: + default: false + type: boolean + fencingPause: + default: 2 + format: int32 + type: integer + fencingTimeout: + default: 10 + format: int32 + type: integer + mode: + default: disabled + enum: + - disabled + - eventual + - stateful + - raft + type: string + stateProvider: + enum: + - etcd2 + - stateboard + type: string + stateboard: + properties: + password: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + uril: + type: string + required: + - uril + type: object + timeout: + default: 20 + format: int32 + type: integer + type: object + foreignLeader: + type: string + listenPort: + default: 3301 + format: int32 + type: integer + required: + - failover + type: object + status: + properties: + bootstrapped: + default: false + type: boolean + leader: + type: string + phase: + default: Pending + type: string + required: + - bootstrapped + - phase + type: object + type: object served: true storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crd/bases/tarantool.io_replicasettemplates.yaml b/config/crd/bases/tarantool.io_replicasettemplates.yaml index b507699b..38628ca7 100644 --- a/config/crd/bases/tarantool.io_replicasettemplates.yaml +++ b/config/crd/bases/tarantool.io_replicasettemplates.yaml @@ -1,10 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.10.0 creationTimestamp: null name: replicasettemplates.tarantool.io spec: @@ -19,87 +18,43 @@ spec: - name: v1alpha1 schema: openAPIV3Schema: - description: ReplicasetTemplate is the Schema for the replicasettemplates - API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: - description: A StatefulSetSpec is the specification of a StatefulSet. properties: minReadySeconds: - description: Minimum number of seconds for which a newly created pod - should be ready without any of its container crashing for it to - be considered available. Defaults to 0 (pod will be considered available - as soon as it is ready) This is an alpha field and requires enabling - StatefulSetMinReadySeconds feature gate. format: int32 type: integer + persistentVolumeClaimRetentionPolicy: + properties: + whenDeleted: + type: string + whenScaled: + type: string + type: object podManagementPolicy: - description: podManagementPolicy controls how pods are created during - initial scale up, when replacing pods on nodes, or when scaling - down. The default policy is `OrderedReady`, where pods are created - in increasing order (pod-0, then pod-1, etc) and the controller - will wait until each pod is ready before continuing. When scaling - down, the pods are removed in the opposite order. The alternative - policy is `Parallel` which will create pods in parallel to match - the desired scale without waiting, and on scale down will delete - all pods at once. type: string replicas: - description: 'replicas is the desired number of replicas of the given - Template. These are replicas in the sense that they are instantiations - of the same Template, but individual replicas also have a consistent - identity. If unspecified, defaults to 1. TODO: Consider a rename - of this field.' format: int32 type: integer revisionHistoryLimit: - description: revisionHistoryLimit is the maximum number of revisions - that will be maintained in the StatefulSet's revision history. The - revision history consists of all revisions not represented by a - currently applied StatefulSetSpec version. The default value is - 10. format: int32 type: integer selector: - description: 'selector is a label query over pods that should match - the replica count. It must match the pod template''s labels. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector requirement is a selector that - contains values, a key, and an operator that relates the key - and values. properties: key: - description: key is the label key that the selector applies - to. type: string operator: - description: operator represents a key's relationship to - a set of values. Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of string values. If the - operator is In or NotIn, the values array must be non-empty. - If the operator is Exists or DoesNotExist, the values - array must be empty. This array is replaced during a strategic - merge patch. items: type: string type: array @@ -111,28 +66,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single - {key,value} in the matchLabels map is equivalent to an element - of matchExpressions, whose key field is "key", the operator - is "In", and the values array contains only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic serviceName: - description: 'serviceName is the name of the service that governs - this StatefulSet. This service must exist before the StatefulSet, - and is responsible for the network identity of the set. Pods get - DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local - where "pod-specific-string" is managed by the StatefulSet controller.' type: string template: - description: template is the object that describes the pod that will - be created if insufficient replicas are detected. Each pod stamped - out by the StatefulSet will fulfill this Template, but have a unique - identity from the rest of the StatefulSet. properties: metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' properties: annotations: additionalProperties: @@ -152,76 +93,27 @@ spec: type: string type: object spec: - description: 'Specification of the desired behavior of the pod. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' properties: activeDeadlineSeconds: - description: Optional duration in seconds the pod may be active - on the node relative to StartTime before the system will - actively try to mark it failed and kill associated containers. - Value must be a positive integer. format: int64 type: integer affinity: - description: If specified, the pod's scheduling constraints properties: nodeAffinity: - description: Describes node affinity scheduling rules - for the pod. properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule - pods to nodes that satisfy the affinity expressions - specified by this field, but it may choose a node - that violates one or more of the expressions. The - node that is most preferred is the one with the - greatest sum of weights, i.e. for each node that - meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements - of this field and adding "weight" to the sum if - the node matches the corresponding matchExpressions; - the node(s) with the highest sum are the most preferred. items: - description: An empty preferred scheduling term - matches all objects with implicit weight 0 (i.e. - it's a no-op). A null preferred scheduling term - matches no objects (i.e. is also a no-op). properties: preference: - description: A node selector term, associated - with the corresponding weight. properties: matchExpressions: - description: A list of node selector requirements - by node's labels. items: - description: A node selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: The label key that the - selector applies to. type: string operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string values. - If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. - If the operator is Gt or Lt, the - values array must have a single - element, which will be interpreted - as an integer. This array is replaced - during a strategic merge patch. items: type: string type: array @@ -231,35 +123,13 @@ spec: type: object type: array matchFields: - description: A list of node selector requirements - by node's fields. items: - description: A node selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: The label key that the - selector applies to. type: string operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string values. - If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. - If the operator is Gt or Lt, the - values array must have a single - element, which will be interpreted - as an integer. This array is replaced - during a strategic merge patch. items: type: string type: array @@ -269,10 +139,8 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic weight: - description: Weight associated with matching - the corresponding nodeSelectorTerm, in the - range 1-100. format: int32 type: integer required: @@ -281,53 +149,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the - affinity requirements specified by this field cease - to be met at some point during pod execution (e.g. - due to an update), the system may or may not try - to eventually evict the pod from its node. properties: nodeSelectorTerms: - description: Required. A list of node selector - terms. The terms are ORed. items: - description: A null or empty node selector term - matches no objects. The requirements of them - are ANDed. The TopologySelectorTerm type implements - a subset of the NodeSelectorTerm. properties: matchExpressions: - description: A list of node selector requirements - by node's labels. items: - description: A node selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: The label key that the - selector applies to. type: string operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string values. - If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. - If the operator is Gt or Lt, the - values array must have a single - element, which will be interpreted - as an integer. This array is replaced - during a strategic merge patch. items: type: string type: array @@ -337,35 +170,13 @@ spec: type: object type: array matchFields: - description: A list of node selector requirements - by node's fields. items: - description: A node selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: The label key that the - selector applies to. type: string operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string values. - If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. - If the operator is Gt or Lt, the - values array must have a single - element, which will be interpreted - as an integer. This array is replaced - during a strategic merge patch. items: type: string type: array @@ -375,73 +186,30 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic type: array required: - nodeSelectorTerms type: object + x-kubernetes-map-type: atomic type: object podAffinity: - description: Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule - pods to nodes that satisfy the affinity expressions - specified by this field, but it may choose a node - that violates one or more of the expressions. The - node that is most preferred is the one with the - greatest sum of weights, i.e. for each node that - meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements - of this field and adding "weight" to the sum if - the node has pods which matches the corresponding - podAffinityTerm; the node(s) with the highest sum - are the most preferred. items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) properties: podAffinityTerm: - description: Required. A pod affinity term, - associated with the corresponding weight. properties: labelSelector: - description: A label query over a set of - resources, in this case pods. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array @@ -453,59 +221,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - This field is beta-level and is only honored - when PodAffinityNamespaceSelector feature - is enabled. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array @@ -517,45 +245,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose - value of the label with key topologyKey - matches that of any node on which any - of the selected pods is running. Empty - topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with matching - the corresponding podAffinityTerm, in the - range 1-100. format: int32 type: integer required: @@ -564,59 +266,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the - affinity requirements specified by this field cease - to be met at some point during pod execution (e.g. - due to a pod label update), the system may or may - not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes - corresponding to each podAffinityTerm are intersected, - i.e. all terms must be satisfied. items: - description: Defines a set of pods (namely those - matching the labelSelector relative to the given - namespace(s)) that this pod should be co-located - (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node - whose value of the label with key - matches that of any node on which a pod of the - set of pods is running properties: labelSelector: - description: A label query over a set of resources, - in this case pods. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label key - that the selector applies to. type: string operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. items: type: string type: array @@ -628,54 +289,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. This - field is beta-level and is only honored when - PodAffinityNamespaceSelector feature is enabled. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label key - that the selector applies to. type: string operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. items: type: string type: array @@ -687,34 +313,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the - pods matching the labelSelector in the specified - namespaces, where co-located is defined as - running on a node whose value of the label - with key topologyKey matches that of any node - on which any of the selected pods is running. - Empty topologyKey is not allowed. type: string required: - topologyKey @@ -722,67 +328,22 @@ spec: type: array type: object podAntiAffinity: - description: Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, - etc. as some other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule - pods to nodes that satisfy the anti-affinity expressions - specified by this field, but it may choose a node - that violates one or more of the expressions. The - node that is most preferred is the one with the - greatest sum of weights, i.e. for each node that - meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity - expressions, etc.), compute a sum by iterating through - the elements of this field and adding "weight" to - the sum if the node has pods which matches the corresponding - podAffinityTerm; the node(s) with the highest sum - are the most preferred. items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) properties: podAffinityTerm: - description: Required. A pod affinity term, - associated with the corresponding weight. properties: labelSelector: - description: A label query over a set of - resources, in this case pods. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array @@ -794,59 +355,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - This field is beta-level and is only honored - when PodAffinityNamespaceSelector feature - is enabled. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array @@ -858,45 +379,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose - value of the label with key topologyKey - matches that of any node on which any - of the selected pods is running. Empty - topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with matching - the corresponding podAffinityTerm, in the - range 1-100. format: int32 type: integer required: @@ -905,59 +400,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the - anti-affinity requirements specified by this field - cease to be met at some point during pod execution - (e.g. due to a pod label update), the system may - or may not try to eventually evict the pod from - its node. When there are multiple elements, the - lists of nodes corresponding to each podAffinityTerm - are intersected, i.e. all terms must be satisfied. items: - description: Defines a set of pods (namely those - matching the labelSelector relative to the given - namespace(s)) that this pod should be co-located - (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node - whose value of the label with key - matches that of any node on which a pod of the - set of pods is running properties: labelSelector: - description: A label query over a set of resources, - in this case pods. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label key - that the selector applies to. type: string operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. items: type: string type: array @@ -969,54 +423,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. This - field is beta-level and is only honored when - PodAffinityNamespaceSelector feature is enabled. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label key - that the selector applies to. type: string operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. items: type: string type: array @@ -1028,34 +447,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the - pods matching the labelSelector in the specified - namespaces, where co-located is defined as - running on a node whose value of the label - with key topologyKey matches that of any node - on which any of the selected pods is running. - Empty topologyKey is not allowed. type: string required: - topologyKey @@ -1064,279 +463,130 @@ spec: type: object type: object automountServiceAccountToken: - description: AutomountServiceAccountToken indicates whether - a service account token should be automatically mounted. type: boolean containers: - description: List of containers belonging to the pod. Containers - cannot currently be added or removed. There must be at least - one container in a Pod. Cannot be updated. items: - description: A single application container that you want - to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The docker - image''s CMD is used if this is not provided. Variable - references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed within - a shell. The docker image''s ENTRYPOINT is used if - this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If - a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to set in - the container. Cannot be updated. items: - description: EnvVar represents an environment variable - present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment - variables in the container and any service environment - variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' type: string valueFrom: - description: Source for the environment variable's - value. Cannot be used if value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: - supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema the - FieldPath is written in terms of, defaults - to "v1". type: string fieldPath: - description: Path of the field to select - in the specified API version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, - requests.cpu, requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: required - for volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format - of the exposed resources, defaults to - "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret in - the pod's namespace properties: key: - description: The key of the secret to - select from. Must be a valid secret - key. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined within - a source must be a C_IDENTIFIER. All invalid keys - will be reported as an event when the container is - starting. When a key exists in multiple sources, the - value associated with the last source will take precedence. - Values defined by an Env with a duplicate key will - take precedence. Cannot be updated. items: - description: EnvFromSource represents the source of - a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to prepend - to each key in the ConfigMap. Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret must - be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config - management to default or override container images - in workload controllers like Deployments and StatefulSets.' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, - IfNotPresent. Defaults to Always if :latest tag is - specified, or IfNotPresent otherwise. Cannot be updated. - More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Actions that the management system should - take in response to container lifecycle events. Cannot - be updated. properties: postStart: - description: 'PostStart is called immediately after - a container is created. If the handler fails, - the container is terminated and restarted according - to its restart policy. Other management of the - container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -1344,105 +594,49 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately before - a container is terminated due to an API request - or management event such as liveness/startup probe - failure, preemption, resource contention, etc. - The handler is not called if the container crashes - or exits. The reason for termination is passed - to the handler. The Pod''s termination grace period - countdown begins before the PreStop hooked is - executed. Regardless of the outcome of the handler, - the container will eventually terminate within - the Pod''s termination grace period. Other management - of the container blocks until the hook completes - or until the termination grace period is reached. - More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -1450,43 +644,25 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -1494,55 +670,37 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. - Container will be restarted if the probe fails. Cannot - be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -1550,134 +708,62 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the container specified as a DNS_LABEL. - Each container in a pod must have a unique name (DNS_LABEL). - Cannot be updated. type: string ports: - description: List of ports to expose from the container. - Exposing a port here gives the system additional information - about the network connections a container uses, but - is primarily informational. Not specifying a port - here DOES NOT prevent that port from being exposed. - Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from - the network. Cannot be updated. items: - description: ContainerPort represents a network port - in a single container. properties: containerPort: - description: Number of port to expose on the pod's - IP address. This must be a valid port number, - 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the external - port to. type: string hostPort: - description: Number of port to expose on the host. - If specified, this must be a valid port number, - 0 < x < 65536. If HostNetwork is specified, - this must match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in - a pod must have a unique name. Name for the - port that can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, - or SCTP. Defaults to "TCP". type: string required: - containerPort @@ -1688,55 +774,37 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if - the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -1744,91 +812,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' properties: limits: additionalProperties: @@ -1837,8 +860,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -1847,242 +868,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is - omitted for a container, it defaults to Limits - if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges than - its parent process. This bool directly controls - if the no_new_privs flag will be set on the container - process. AllowPrivilegeEscalation is true always - when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop when running - containers. Defaults to the default set of capabilities - granted by the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array type: object privileged: - description: Run container in privileged mode. Processes - in privileged containers are essentially equivalent - to root on the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type of proc - mount to use for the containers. The default is - DefaultProcMount which uses the container runtime - defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to - be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has a read-only - root filesystem. Default is false. type: boolean runAsGroup: - description: The GID to run the entrypoint of the - container process. Uses runtime default if unset. - May also be set in PodSecurityContext. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must run - as a non-root user. If true, the Kubelet will - validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no - such validation will be performed. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of the - container process. Defaults to user specified - in image metadata if unspecified. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied to - the container. If unspecified, the container runtime - will allocate a random SELinux context for each - container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: level: - description: Level is SELinux level label that - applies to the container. type: string role: - description: Role is a SELinux role label that - applies to the container. type: string type: - description: Type is a SELinux type label that - applies to the container. type: string user: - description: User is a SELinux user label that - applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use by this - container. If seccomp options are provided at - both the pod & container level, the container - options override the pod options. properties: localhostProfile: - description: localhostProfile indicates a profile - defined in a file on the node should be used. - The profile must be preconfigured on the node - to work. Must be a descending path, relative - to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". type: string type: - description: "type indicates which kind of seccomp - profile will be applied. Valid options are: - \n Localhost - a profile defined in a file - on the node should be used. RuntimeDefault - - the container runtime default profile should - be used. Unconfined - no profile should be - applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings applied - to all containers. If unspecified, the options - from the PodSecurityContext will be used. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the - GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name - of the GMSA credential spec to use. type: string hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run - the entrypoint of the container process. Defaults - to the user specified in image metadata if - unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence. type: string type: object type: object startupProbe: - description: 'StartupProbe indicates that the Pod has - successfully initialized. If specified, no other probes - are executed until this completes successfully. If - this probe fails, the Pod will be restarted, just - as if the livenessProbe failed. This can be used to - provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time - to load data or warm a cache, than during steady-state - operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -2090,149 +970,61 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. If this - is not set, reads from stdin in the container will - always result in EOF. Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close - the stdin channel after it has been opened by a single - attach. When stdin is true the stdin stream will remain - open across multiple attach sessions. If stdinOnce - is set to true, stdin is opened on container start, - is empty until the first client attaches to stdin, - and then remains open and accepts data until the client - disconnects, at which time stdin is closed and remains - closed until the container is restarted. If this flag - is false, a container processes that reads from stdin - will never receive an EOF. Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which - the container''s termination message will be written - is mounted into the container''s filesystem. Message - written is intended to be brief final status, such - as an assertion failure message. Will be truncated - by the node if greater than 4096 bytes. The total - message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot - be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message should - be populated. File will use the contents of terminationMessagePath - to populate the container status message on both success - and failure. FallbackToLogsOnError will use the last - chunk of container log output if the termination message - file is empty and the container exited with an error. - The log output is limited to 2048 bytes or 80 lines, - whichever is smaller. Defaults to File. Cannot be - updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to be true. - Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block devices - to be used by the container. items: - description: volumeDevice describes a mapping of a - raw block device within a container. properties: devicePath: - description: devicePath is the path inside of - the container that the device will be mapped - to. type: string name: - description: name must match the name of a persistentVolumeClaim - in the pod type: string required: - devicePath @@ -2240,44 +1032,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting of a - Volume within a container. properties: mountPath: - description: Path within the container at which - the volume should be mounted. Must not contain - ':'. type: string mountPropagation: - description: mountPropagation determines how mounts - are propagated from the host to container and - the other way around. When not set, MountPropagationNone - is used. This field is beta in 1.10. type: string name: - description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write - otherwise (false or unspecified). Defaults to - false. type: boolean subPath: - description: Path within the volume from which - the container's volume should be mounted. Defaults - to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from - which the container's volume should be mounted. - Behaves similarly to SubPath but environment - variable references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath - are mutually exclusive. type: string required: - mountPath @@ -2285,348 +1052,158 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which - might be configured in the container image. Cannot - be updated. type: string required: - name type: object type: array dnsConfig: - description: Specifies the DNS parameters of a pod. Parameters - specified here will be merged to the generated DNS configuration - based on DNSPolicy. properties: nameservers: - description: A list of DNS name server IP addresses. This - will be appended to the base nameservers generated from - DNSPolicy. Duplicated nameservers will be removed. items: type: string type: array options: - description: A list of DNS resolver options. This will - be merged with the base options generated from DNSPolicy. - Duplicated entries will be removed. Resolution options - given in Options will override those that appear in - the base DNSPolicy. items: - description: PodDNSConfigOption defines DNS resolver - options of a pod. properties: name: - description: Required. type: string value: type: string type: object type: array searches: - description: A list of DNS search domains for host-name - lookup. This will be appended to the base search paths - generated from DNSPolicy. Duplicated search paths will - be removed. items: type: string type: array type: object dnsPolicy: - description: Set DNS policy for the pod. Defaults to "ClusterFirst". - Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', - 'Default' or 'None'. DNS parameters given in DNSConfig will - be merged with the policy selected with DNSPolicy. To have - DNS options set along with hostNetwork, you have to specify - DNS policy explicitly to 'ClusterFirstWithHostNet'. type: string enableServiceLinks: - description: 'EnableServiceLinks indicates whether information - about services should be injected into pod''s environment - variables, matching the syntax of Docker links. Optional: - Defaults to true.' type: boolean ephemeralContainers: - description: List of ephemeral containers run in this pod. - Ephemeral containers may be run in an existing pod to perform - user-initiated actions such as debugging. This list cannot - be specified when creating a pod, and it cannot be modified - by updating the pod spec. In order to add an ephemeral container - to an existing pod, use the pod's ephemeralcontainers subresource. - This field is alpha-level and is only honored by servers - that enable the EphemeralContainers feature. items: - description: An EphemeralContainer is a container that may - be added temporarily to an existing pod for user-initiated - activities such as debugging. Ephemeral containers have - no resource or scheduling guarantees, and they will not - be restarted when they exit or when a pod is removed or - restarted. If an ephemeral container causes a pod to exceed - its resource allocation, the pod may be evicted. Ephemeral - containers may not be added by directly updating the pod - spec. They must be added via the pod's ephemeralcontainers - subresource, and they will appear in the pod spec once - added. This is an alpha feature enabled by the EphemeralContainers - feature flag. properties: args: - description: 'Arguments to the entrypoint. The docker - image''s CMD is used if this is not provided. Variable - references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed within - a shell. The docker image''s ENTRYPOINT is used if - this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If - a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to set in - the container. Cannot be updated. items: - description: EnvVar represents an environment variable - present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment - variables in the container and any service environment - variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' type: string valueFrom: - description: Source for the environment variable's - value. Cannot be used if value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: - supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema the - FieldPath is written in terms of, defaults - to "v1". type: string fieldPath: - description: Path of the field to select - in the specified API version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, - requests.cpu, requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: required - for volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format - of the exposed resources, defaults to - "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret in - the pod's namespace properties: key: - description: The key of the secret to - select from. Must be a valid secret - key. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined within - a source must be a C_IDENTIFIER. All invalid keys - will be reported as an event when the container is - starting. When a key exists in multiple sources, the - value associated with the last source will take precedence. - Values defined by an Env with a duplicate key will - take precedence. Cannot be updated. items: - description: EnvFromSource represents the source of - a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to prepend - to each key in the ConfigMap. Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret must - be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, - IfNotPresent. Defaults to Always if :latest tag is - specified, or IfNotPresent otherwise. Cannot be updated. - More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Lifecycle is not allowed for ephemeral - containers. properties: postStart: - description: 'PostStart is called immediately after - a container is created. If the handler fails, - the container is terminated and restarted according - to its restart policy. Other management of the - container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -2634,105 +1211,49 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately before - a container is terminated due to an API request - or management event such as liveness/startup probe - failure, preemption, resource contention, etc. - The handler is not called if the container crashes - or exits. The reason for termination is passed - to the handler. The Pod''s termination grace period - countdown begins before the PreStop hooked is - executed. Regardless of the outcome of the handler, - the container will eventually terminate within - the Pod''s termination grace period. Other management - of the container blocks until the hook completes - or until the termination grace period is reached. - More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -2740,43 +1261,25 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -2784,53 +1287,37 @@ spec: type: object type: object livenessProbe: - description: Probes are not allowed for ephemeral containers. properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -2838,180 +1325,103 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the ephemeral container specified - as a DNS_LABEL. This name must be unique among all - containers, init containers and ephemeral containers. type: string ports: - description: Ports are not allowed for ephemeral containers. items: - description: ContainerPort represents a network port - in a single container. properties: containerPort: - description: Number of port to expose on the pod's - IP address. This must be a valid port number, - 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the external - port to. type: string hostPort: - description: Number of port to expose on the host. - If specified, this must be a valid port number, - 0 < x < 65536. If HostNetwork is specified, - this must match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in - a pod must have a unique name. Name for the - port that can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, - or SCTP. Defaults to "TCP". type: string required: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: - description: Probes are not allowed for ephemeral containers. properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -3019,92 +1429,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: Resources are not allowed for ephemeral - containers. Ephemeral containers use spare resources - already allocated to the pod. properties: limits: additionalProperties: @@ -3113,8 +1477,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -3123,234 +1485,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is - omitted for a container, it defaults to Limits - if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'Optional: SecurityContext defines the - security options the ephemeral container should be - run with. If set, the fields of SecurityContext override - the equivalent fields of PodSecurityContext.' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges than - its parent process. This bool directly controls - if the no_new_privs flag will be set on the container - process. AllowPrivilegeEscalation is true always - when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop when running - containers. Defaults to the default set of capabilities - granted by the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array type: object privileged: - description: Run container in privileged mode. Processes - in privileged containers are essentially equivalent - to root on the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type of proc - mount to use for the containers. The default is - DefaultProcMount which uses the container runtime - defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to - be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has a read-only - root filesystem. Default is false. type: boolean runAsGroup: - description: The GID to run the entrypoint of the - container process. Uses runtime default if unset. - May also be set in PodSecurityContext. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must run - as a non-root user. If true, the Kubelet will - validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no - such validation will be performed. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of the - container process. Defaults to user specified - in image metadata if unspecified. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied to - the container. If unspecified, the container runtime - will allocate a random SELinux context for each - container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: level: - description: Level is SELinux level label that - applies to the container. type: string role: - description: Role is a SELinux role label that - applies to the container. type: string type: - description: Type is a SELinux type label that - applies to the container. type: string user: - description: User is a SELinux user label that - applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use by this - container. If seccomp options are provided at - both the pod & container level, the container - options override the pod options. properties: localhostProfile: - description: localhostProfile indicates a profile - defined in a file on the node should be used. - The profile must be preconfigured on the node - to work. Must be a descending path, relative - to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". type: string type: - description: "type indicates which kind of seccomp - profile will be applied. Valid options are: - \n Localhost - a profile defined in a file - on the node should be used. RuntimeDefault - - the container runtime default profile should - be used. Unconfined - no profile should be - applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings applied - to all containers. If unspecified, the options - from the PodSecurityContext will be used. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the - GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name - of the GMSA credential spec to use. type: string hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run - the entrypoint of the container process. Defaults - to the user specified in image metadata if - unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence. type: string type: object type: object startupProbe: - description: Probes are not allowed for ephemeral containers. properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -3358,158 +1587,63 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. If this - is not set, reads from stdin in the container will - always result in EOF. Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close - the stdin channel after it has been opened by a single - attach. When stdin is true the stdin stream will remain - open across multiple attach sessions. If stdinOnce - is set to true, stdin is opened on container start, - is empty until the first client attaches to stdin, - and then remains open and accepts data until the client - disconnects, at which time stdin is closed and remains - closed until the container is restarted. If this flag - is false, a container processes that reads from stdin - will never receive an EOF. Default is false type: boolean targetContainerName: - description: If set, the name of the container from - PodSpec that this ephemeral container targets. The - ephemeral container will be run in the namespaces - (IPC, PID, etc) of this container. If not set then - the ephemeral container is run in whatever namespaces - are shared for the pod. Note that the container runtime - must support this feature. type: string terminationMessagePath: - description: 'Optional: Path at which the file to which - the container''s termination message will be written - is mounted into the container''s filesystem. Message - written is intended to be brief final status, such - as an assertion failure message. Will be truncated - by the node if greater than 4096 bytes. The total - message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot - be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message should - be populated. File will use the contents of terminationMessagePath - to populate the container status message on both success - and failure. FallbackToLogsOnError will use the last - chunk of container log output if the termination message - file is empty and the container exited with an error. - The log output is limited to 2048 bytes or 80 lines, - whichever is smaller. Defaults to File. Cannot be - updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to be true. - Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block devices - to be used by the container. items: - description: volumeDevice describes a mapping of a - raw block device within a container. properties: devicePath: - description: devicePath is the path inside of - the container that the device will be mapped - to. type: string name: - description: name must match the name of a persistentVolumeClaim - in the pod type: string required: - devicePath @@ -3517,44 +1651,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting of a - Volume within a container. properties: mountPath: - description: Path within the container at which - the volume should be mounted. Must not contain - ':'. type: string mountPropagation: - description: mountPropagation determines how mounts - are propagated from the host to container and - the other way around. When not set, MountPropagationNone - is used. This field is beta in 1.10. type: string name: - description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write - otherwise (false or unspecified). Defaults to - false. type: boolean subPath: - description: Path within the volume from which - the container's volume should be mounted. Defaults - to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from - which the container's volume should be mounted. - Behaves similarly to SubPath but environment - variable references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath - are mutually exclusive. type: string required: - mountPath @@ -3562,350 +1671,163 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which - might be configured in the container image. Cannot - be updated. type: string required: - name type: object type: array hostAliases: - description: HostAliases is an optional list of hosts and - IPs that will be injected into the pod's hosts file if specified. - This is only valid for non-hostNetwork pods. items: - description: HostAlias holds the mapping between IP and - hostnames that will be injected as an entry in the pod's - hosts file. properties: hostnames: - description: Hostnames for the above IP address. items: type: string type: array ip: - description: IP address of the host file entry. type: string type: object type: array hostIPC: - description: 'Use the host''s ipc namespace. Optional: Default - to false.' type: boolean hostNetwork: - description: Host networking requested for this pod. Use the - host's network namespace. If this option is set, the ports - that will be used must be specified. Default to false. type: boolean hostPID: - description: 'Use the host''s pid namespace. Optional: Default - to false.' + type: boolean + hostUsers: type: boolean hostname: - description: Specifies the hostname of the Pod If not specified, - the pod's hostname will be set to a system-defined value. type: string imagePullSecrets: - description: 'ImagePullSecrets is an optional list of references - to secrets in the same namespace to use for pulling any - of the images used by this PodSpec. If specified, these - secrets will be passed to individual puller implementations - for them to use. For example, in the case of docker, only - DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' items: - description: LocalObjectReference contains enough information - to let you locate the referenced object inside the same - namespace. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + x-kubernetes-map-type: atomic type: array initContainers: - description: 'List of initialization containers belonging - to the pod. Init containers are executed in order prior - to containers being started. If any init container fails, - the pod is considered to have failed and is handled according - to its restartPolicy. The name for an init container or - normal container must be unique among all containers. Init - containers may not have Lifecycle actions, Readiness probes, - Liveness probes, or Startup probes. The resourceRequirements - of an init container are taken into account during scheduling - by finding the highest request/limit for each resource type, - and then using the max of of that value or the sum of the - normal containers. Limits are applied to init containers - in a similar fashion. Init containers cannot currently be - added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' items: - description: A single application container that you want - to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The docker - image''s CMD is used if this is not provided. Variable - references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed within - a shell. The docker image''s ENTRYPOINT is used if - this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If - a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to set in - the container. Cannot be updated. items: - description: EnvVar represents an environment variable - present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment - variables in the container and any service environment - variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' type: string valueFrom: - description: Source for the environment variable's - value. Cannot be used if value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: - supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema the - FieldPath is written in terms of, defaults - to "v1". type: string fieldPath: - description: Path of the field to select - in the specified API version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, - requests.cpu, requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: required - for volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format - of the exposed resources, defaults to - "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret in - the pod's namespace properties: key: - description: The key of the secret to - select from. Must be a valid secret - key. type: string name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined within - a source must be a C_IDENTIFIER. All invalid keys - will be reported as an event when the container is - starting. When a key exists in multiple sources, the - value associated with the last source will take precedence. - Values defined by an Env with a duplicate key will - take precedence. Cannot be updated. items: - description: EnvFromSource represents the source of - a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to prepend - to each key in the ConfigMap. Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret must - be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config - management to default or override container images - in workload controllers like Deployments and StatefulSets.' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, - IfNotPresent. Defaults to Always if :latest tag is - specified, or IfNotPresent otherwise. Cannot be updated. - More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Actions that the management system should - take in response to container lifecycle events. Cannot - be updated. properties: postStart: - description: 'PostStart is called immediately after - a container is created. If the handler fails, - the container is terminated and restarted according - to its restart policy. Other management of the - container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -3913,105 +1835,49 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately before - a container is terminated due to an API request - or management event such as liveness/startup probe - failure, preemption, resource contention, etc. - The handler is not called if the container crashes - or exits. The reason for termination is passed - to the handler. The Pod''s termination grace period - countdown begins before the PreStop hooked is - executed. Regardless of the outcome of the handler, - the container will eventually terminate within - the Pod''s termination grace period. Other management - of the container blocks until the hook completes - or until the termination grace period is reached. - More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the action - to take. properties: command: - description: Command is the command line - to execute inside the container, the working - directory for the command is root ('/') - in the container's filesystem. The command - is simply exec'd, it is not run inside - a shell, so traditional shell instructions - ('|', etc) won't work. To use a shell, - you need to explicitly call out to that - shell. Exit status of 0 is treated as - live/healthy and non-zero is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set - "Host" in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the - request. HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -4019,43 +1885,25 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle - hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number must - be in the range 1 to 65535. Name must - be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -4063,55 +1911,37 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. - Container will be restarted if the probe fails. Cannot - be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -4119,134 +1949,62 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the container specified as a DNS_LABEL. - Each container in a pod must have a unique name (DNS_LABEL). - Cannot be updated. type: string ports: - description: List of ports to expose from the container. - Exposing a port here gives the system additional information - about the network connections a container uses, but - is primarily informational. Not specifying a port - here DOES NOT prevent that port from being exposed. - Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from - the network. Cannot be updated. items: - description: ContainerPort represents a network port - in a single container. properties: containerPort: - description: Number of port to expose on the pod's - IP address. This must be a valid port number, - 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the external - port to. type: string hostPort: - description: Number of port to expose on the host. - If specified, this must be a valid port number, - 0 < x < 65536. If HostNetwork is specified, - this must match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in - a pod must have a unique name. Name for the - port that can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, - or SCTP. Defaults to "TCP". type: string required: - containerPort @@ -4257,55 +2015,37 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if - the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -4313,91 +2053,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' properties: limits: additionalProperties: @@ -4406,8 +2101,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -4416,242 +2109,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is - omitted for a container, it defaults to Limits - if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges than - its parent process. This bool directly controls - if the no_new_privs flag will be set on the container - process. AllowPrivilegeEscalation is true always - when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop when running - containers. Defaults to the default set of capabilities - granted by the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent POSIX capabilities - type type: string type: array type: object privileged: - description: Run container in privileged mode. Processes - in privileged containers are essentially equivalent - to root on the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type of proc - mount to use for the containers. The default is - DefaultProcMount which uses the container runtime - defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to - be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has a read-only - root filesystem. Default is false. type: boolean runAsGroup: - description: The GID to run the entrypoint of the - container process. Uses runtime default if unset. - May also be set in PodSecurityContext. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must run - as a non-root user. If true, the Kubelet will - validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no - such validation will be performed. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of the - container process. Defaults to user specified - in image metadata if unspecified. May also be - set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in - SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied to - the container. If unspecified, the container runtime - will allocate a random SELinux context for each - container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: level: - description: Level is SELinux level label that - applies to the container. type: string role: - description: Role is a SELinux role label that - applies to the container. type: string type: - description: Type is a SELinux type label that - applies to the container. type: string user: - description: User is a SELinux user label that - applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use by this - container. If seccomp options are provided at - both the pod & container level, the container - options override the pod options. properties: localhostProfile: - description: localhostProfile indicates a profile - defined in a file on the node should be used. - The profile must be preconfigured on the node - to work. Must be a descending path, relative - to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". type: string type: - description: "type indicates which kind of seccomp - profile will be applied. Valid options are: - \n Localhost - a profile defined in a file - on the node should be used. RuntimeDefault - - the container runtime default profile should - be used. Unconfined - no profile should be - applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings applied - to all containers. If unspecified, the options - from the PodSecurityContext will be used. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the - GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name - of the GMSA credential spec to use. type: string hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run - the entrypoint of the container process. Defaults - to the user specified in image metadata if - unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence. type: string type: object type: object startupProbe: - description: 'StartupProbe indicates that the Pod has - successfully initialized. If specified, no other probes - are executed until this completes successfully. If - this probe fails, the Pod will be restarted, just - as if the livenessProbe failed. This can be used to - provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time - to load data or warm a cache, than during steady-state - operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following should - be specified. Exec specifies the action to take. properties: command: - description: Command is the command line to - execute inside the container, the working - directory for the command is root ('/') in - the container's filesystem. The command is - simply exec'd, it is not run inside a shell, - so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is - treated as live/healthy and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http request - to perform. properties: host: - description: Host name to connect to, defaults - to the pod IP. You probably want to set "Host" - in httpHeaders instead. type: string httpHeaders: - description: Custom headers to set in the request. - HTTP allows repeated headers. items: - description: HTTPHeader describes a custom - header to be used in HTTP probes properties: name: - description: The header field name type: string value: - description: The header field value type: string required: - name @@ -4659,149 +2211,61 @@ spec: type: object type: array path: - description: Path to access on the HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to - the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container - has started before liveness probes are initiated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the - probe. Default to 10 seconds. Minimum value is - 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the - probe to be considered successful after having - failed. Defaults to 1. Must be 1 for liveness - and startup. Minimum value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action involving - a TCP port. TCP hooks not yet supported TODO: - implement a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name to connect - to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access - on the container. Number must be in the range - 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the - probe times out. Defaults to 1 second. Minimum - value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. If this - is not set, reads from stdin in the container will - always result in EOF. Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close - the stdin channel after it has been opened by a single - attach. When stdin is true the stdin stream will remain - open across multiple attach sessions. If stdinOnce - is set to true, stdin is opened on container start, - is empty until the first client attaches to stdin, - and then remains open and accepts data until the client - disconnects, at which time stdin is closed and remains - closed until the container is restarted. If this flag - is false, a container processes that reads from stdin - will never receive an EOF. Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which - the container''s termination message will be written - is mounted into the container''s filesystem. Message - written is intended to be brief final status, such - as an assertion failure message. Will be truncated - by the node if greater than 4096 bytes. The total - message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot - be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message should - be populated. File will use the contents of terminationMessagePath - to populate the container status message on both success - and failure. FallbackToLogsOnError will use the last - chunk of container log output if the termination message - file is empty and the container exited with an error. - The log output is limited to 2048 bytes or 80 lines, - whichever is smaller. Defaults to File. Cannot be - updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to be true. - Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block devices - to be used by the container. items: - description: volumeDevice describes a mapping of a - raw block device within a container. properties: devicePath: - description: devicePath is the path inside of - the container that the device will be mapped - to. type: string name: - description: name must match the name of a persistentVolumeClaim - in the pod type: string required: - devicePath @@ -4809,44 +2273,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting of a - Volume within a container. properties: mountPath: - description: Path within the container at which - the volume should be mounted. Must not contain - ':'. type: string mountPropagation: - description: mountPropagation determines how mounts - are propagated from the host to container and - the other way around. When not set, MountPropagationNone - is used. This field is beta in 1.10. type: string name: - description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write - otherwise (false or unspecified). Defaults to - false. type: boolean subPath: - description: Path within the volume from which - the container's volume should be mounted. Defaults - to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from - which the container's volume should be mounted. - Behaves similarly to SubPath but environment - variable references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath - are mutually exclusive. type: string required: - mountPath @@ -4854,30 +2293,25 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which - might be configured in the container image. Cannot - be updated. type: string required: - name type: object type: array nodeName: - description: NodeName is a request to schedule this pod onto - a specific node. If it is non-empty, the scheduler simply - schedules this pod onto that node, assuming that it fits - resource requirements. type: string nodeSelector: additionalProperties: type: string - description: 'NodeSelector is a selector which must be true - for the pod to fit on a node. Selector which must match - a node''s labels for the pod to be scheduled on that node. - More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' type: object x-kubernetes-map-type: atomic + os: + properties: + name: + type: string + required: + - name + type: object overhead: additionalProperties: anyOf: @@ -4885,205 +2319,75 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Overhead represents the resource overhead associated - with running a pod for a given RuntimeClass. This field - will be autopopulated at admission time by the RuntimeClass - admission controller. If the RuntimeClass admission controller - is enabled, overhead must not be set in Pod create requests. - The RuntimeClass admission controller will reject Pod create - requests which have the overhead already set. If RuntimeClass - is configured and selected in the PodSpec, Overhead will - be set to the value defined in the corresponding RuntimeClass, - otherwise it will remain unset and treated as zero. More - info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md - This field is beta-level as of Kubernetes v1.18, and is - only honored by servers that enable the PodOverhead feature.' type: object preemptionPolicy: - description: PreemptionPolicy is the Policy for preempting - pods with lower priority. One of Never, PreemptLowerPriority. - Defaults to PreemptLowerPriority if unset. This field is - beta-level, gated by the NonPreemptingPriority feature-gate. type: string priority: - description: The priority value. Various system components - use this field to find the priority of the pod. When Priority - Admission Controller is enabled, it prevents users from - setting this field. The admission controller populates this - field from PriorityClassName. The higher the value, the - higher the priority. format: int32 type: integer priorityClassName: - description: If specified, indicates the pod's priority. "system-node-critical" - and "system-cluster-critical" are two special keywords which - indicate the highest priorities with the former being the - highest priority. Any other name must be defined by creating - a PriorityClass object with that name. If not specified, - the pod priority will be default or zero if there is no - default. type: string readinessGates: - description: 'If specified, all readiness gates will be evaluated - for pod readiness. A pod is ready when all its containers - are ready AND all conditions specified in the readiness - gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' items: - description: PodReadinessGate contains the reference to - a pod condition properties: conditionType: - description: ConditionType refers to a condition in - the pod's condition list with matching type. type: string required: - conditionType type: object type: array restartPolicy: - description: 'Restart policy for all containers within the - pod. One of Always, OnFailure, Never. Default to Always. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' type: string runtimeClassName: - description: 'RuntimeClassName refers to a RuntimeClass object - in the node.k8s.io group, which should be used to run this - pod. If no RuntimeClass resource matches the named class, - the pod will not be run. If unset or empty, the "legacy" - RuntimeClass will be used, which is an implicit class with - an empty definition that uses the default runtime handler. - More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class - This is a beta feature as of Kubernetes v1.14.' type: string schedulerName: - description: If specified, the pod will be dispatched by specified - scheduler. If not specified, the pod will be dispatched - by default scheduler. type: string securityContext: - description: 'SecurityContext holds pod-level security attributes - and common container settings. Optional: Defaults to empty. See - type description for default values of each field.' properties: fsGroup: - description: "A special supplemental group that applies - to all containers in a pod. Some volume types allow - the Kubelet to change the ownership of that volume to - be owned by the pod: \n 1. The owning GID will be the - FSGroup 2. The setgid bit is set (new files created - in the volume will be owned by FSGroup) 3. The permission - bits are OR'd with rw-rw---- \n If unset, the Kubelet - will not modify the ownership and permissions of any - volume." format: int64 type: integer fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of - changing ownership and permission of the volume before - being exposed inside Pod. This field will only apply - to volume types which support fsGroup based ownership(and - permissions). It will have no effect on ephemeral volume - types such as: secret, configmaps and emptydir. Valid - values are "OnRootMismatch" and "Always". If not specified, - "Always" is used.' type: string runAsGroup: - description: The GID to run the entrypoint of the container - process. Uses runtime default if unset. May also be - set in SecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must run as - a non-root user. If true, the Kubelet will validate - the image at runtime to ensure that it does not run - as UID 0 (root) and fail to start the container if it - does. If unset or false, no such validation will be - performed. May also be set in SecurityContext. If set - in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of the container - process. Defaults to user specified in image metadata - if unspecified. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence - for that container. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied to all - containers. If unspecified, the container runtime will - allocate a random SELinux context for each container. May - also be set in SecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. properties: level: - description: Level is SELinux level label that applies - to the container. type: string role: - description: Role is a SELinux role label that applies - to the container. type: string type: - description: Type is a SELinux type label that applies - to the container. type: string user: - description: User is a SELinux user label that applies - to the container. type: string type: object seccompProfile: - description: The seccomp options to use by the containers - in this pod. properties: localhostProfile: - description: localhostProfile indicates a profile - defined in a file on the node should be used. The - profile must be preconfigured on the node to work. - Must be a descending path, relative to the kubelet's - configured seccomp profile location. Must only be - set if type is "Localhost". type: string type: - description: "type indicates which kind of seccomp - profile will be applied. Valid options are: \n Localhost - - a profile defined in a file on the node should - be used. RuntimeDefault - the container runtime - default profile should be used. Unconfined - no - profile should be applied." type: string required: - type type: object supplementalGroups: - description: A list of groups applied to the first process - run in each container, in addition to the container's - primary GID. If unspecified, no groups will be added - to any container. items: format: int64 type: integer type: array sysctls: - description: Sysctls hold a list of namespaced sysctls - used for the pod. Pods with unsupported sysctls (by - the container runtime) might fail to launch. items: - description: Sysctl defines a kernel parameter to be - set properties: name: - description: Name of a property to set type: string value: - description: Value of a property to set type: string required: - name @@ -5091,173 +2395,59 @@ spec: type: object type: array windowsOptions: - description: The Windows specific settings applied to - all containers. If unspecified, the options within a - container's SecurityContext will be used. If set in - both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA - admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec - named by the GMSACredentialSpecName field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of - the GMSA credential spec to use. type: string hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. This - field is alpha-level and will only be honored by - components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. - All of a Pod's containers must have the same effective - HostProcess value (it is not allowed to have a mix - of HostProcess containers and non-HostProcess containers). In - addition, if HostProcess is true then HostNetwork - must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set - in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence. type: string type: object type: object serviceAccount: - description: 'DeprecatedServiceAccount is a depreciated alias - for ServiceAccountName. Deprecated: Use serviceAccountName - instead.' type: string serviceAccountName: - description: 'ServiceAccountName is the name of the ServiceAccount - to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' type: string setHostnameAsFQDN: - description: If true the pod's hostname will be configured - as the pod's FQDN, rather than the leaf name (the default). - In Linux containers, this means setting the FQDN in the - hostname field of the kernel (the nodename field of struct - utsname). In Windows containers, this means setting the - registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters - to FQDN. If a pod does not have FQDN, this has no effect. - Default to false. type: boolean shareProcessNamespace: - description: 'Share a single process namespace between all - of the containers in a pod. When this is set containers - will be able to view and signal processes from other containers - in the same pod, and the first process in each container - will not be assigned PID 1. HostPID and ShareProcessNamespace - cannot both be set. Optional: Default to false.' type: boolean subdomain: - description: If specified, the fully qualified Pod hostname - will be "...svc.". If not specified, the pod will not have a domainname - at all. type: string terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to - terminate gracefully. May be decreased in delete request. - Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). If this value is nil, the default grace period - will be used instead. The grace period is the duration in - seconds after the processes running in the pod are sent - a termination signal and the time when the processes are - forcibly halted with a kill signal. Set this value longer - than the expected cleanup time for your process. Defaults - to 30 seconds. format: int64 type: integer tolerations: - description: If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . properties: effect: - description: Effect indicates the taint effect to match. - Empty means match all taint effects. When specified, - allowed values are NoSchedule, PreferNoSchedule and - NoExecute. type: string key: - description: Key is the taint key that the toleration - applies to. Empty means match all taint keys. If the - key is empty, operator must be Exists; this combination - means to match all values and all keys. type: string operator: - description: Operator represents a key's relationship - to the value. Valid operators are Exists and Equal. - Defaults to Equal. Exists is equivalent to wildcard - for value, so that a pod can tolerate all taints of - a particular category. type: string tolerationSeconds: - description: TolerationSeconds represents the period - of time the toleration (which must be of effect NoExecute, - otherwise this field is ignored) tolerates the taint. - By default, it is not set, which means tolerate the - taint forever (do not evict). Zero and negative values - will be treated as 0 (evict immediately) by the system. format: int64 type: integer value: - description: Value is the taint value the toleration - matches to. If the operator is Exists, the value should - be empty, otherwise just a regular string. type: string type: object type: array topologySpreadConstraints: - description: TopologySpreadConstraints describes how a group - of pods ought to spread across topology domains. Scheduler - will schedule pods in a way which abides by the constraints. - All topologySpreadConstraints are ANDed. items: - description: TopologySpreadConstraint specifies how to spread - matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching - pods. Pods that match this label selector are counted - to determine the number of pods in their corresponding - topology domain. properties: matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. properties: key: - description: key is the label key that the - selector applies to. type: string operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. items: type: string type: array @@ -5269,59 +2459,27 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which - pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the - number of matching pods in the target topology and - the global minimum. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - - if MaxSkew is 1, incoming pod can only be scheduled - to zone3 to become 1/1/1; scheduling it onto zone1(zone2) - would make the ActualSkew(2-0) on zone1(zone2) violate - MaxSkew(1). - if MaxSkew is 2, incoming pod can be - scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies - that satisfy it. It''s a required field. Default value - is 1 and 0 is not allowed.' format: int32 type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string topologyKey: - description: TopologyKey is the key of node labels. - Nodes that have a label with this key and identical - values are considered to be in the same topology. - We consider each as a "bucket", and try - to put balanced number of pods into each bucket. It's - a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal - with a pod if it doesn''t satisfy the spread constraint. - - DoNotSchedule (default) tells the scheduler not - to schedule it. - ScheduleAnyway tells the scheduler - to schedule the pod in any location, but giving - higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" - for an incoming pod if and only if every possible - node assigment for that pod would violate "MaxSkew" - on some topology. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P - | P | P | If WhenUnsatisfiable is set to DoNotSchedule, - incoming pod can only be scheduled to zone2(zone3) - to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) - satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make - it *more* imbalanced. It''s a required field.' type: string required: - maxSkew @@ -5334,233 +2492,106 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map volumes: - description: 'List of volumes that can be mounted by containers - belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' items: - description: Volume represents a named volume in a pod that - may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'AWSElasticBlockStore represents an AWS - Disk resource that is attached to a kubelet''s host - machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'Filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred - to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem - from compromising the machine' type: string partition: - description: 'The partition in the volume that you - want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, - you specify the partition as "1". Similarly, the - volume partition for /dev/sda is "0" (or you can - leave the property empty).' format: int32 type: integer readOnly: - description: 'Specify "true" to force and set the - ReadOnly property in VolumeMounts to "true". If - omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'Unique ID of the persistent disk resource - in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: AzureDisk represents an Azure Data Disk - mount on the host and bind mount to the pod. properties: cachingMode: - description: 'Host Caching mode: None, Read Only, - Read Write.' type: string diskName: - description: The Name of the data disk in the blob - storage type: string diskURI: - description: The URI the data disk in the blob storage type: string fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. type: string kind: - description: 'Expected values Shared: multiple blob - disks per storage account Dedicated: single blob - disk per storage account Managed: azure managed - data disk (only in managed availability set). - defaults to shared' type: string readOnly: - description: Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: AzureFile represents an Azure File Service - mount on the host and bind mount to the pod. properties: readOnly: - description: Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. type: boolean secretName: - description: the name of secret that contains Azure - Storage Account Name and Key type: string shareName: - description: Share Name type: string required: - secretName - shareName type: object cephfs: - description: CephFS represents a Ceph FS mount on the - host that shares a pod's lifetime properties: monitors: - description: 'Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'Optional: Used as the mounted root, - rather than the full Ceph tree, default is /' type: string readOnly: - description: 'Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'Optional: SecretFile is the path to - key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'Optional: SecretRef is reference to - the authentication secret for User, default is - empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic user: - description: 'Optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'Cinder represents a cinder volume attached - and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'Filesystem type to mount. Must be - a filesystem type supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'Optional: points to a secret object - containing parameters used to connect to OpenStack.' properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volume id used to identify the volume - in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: ConfigMap represents a configMap that should - populate this volume properties: defaultMode: - description: 'Optional: mode bits used to set permissions - on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts both octal and - decimal values, JSON requires decimal values for - mode bits. Defaults to 0644. Directories within - the path are not affected by this setting. This - might be in conflict with other options that affect - the file mode, like fsGroup, and the result can - be other mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value pair - in the Data field of the referenced ConfigMap - will be projected into the volume as a file whose - name is the key and content is the value. If specified, - the listed keys will be projected into the specified - paths, and unlisted keys will not be present. - If a key is specified which is not present in - the ConfigMap, the volume setup will error unless - it is marked optional. Paths must be relative - and may not contain the '..' path or start with - '..'. items: - description: Maps a string key to a path within - a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits used to - set permissions on this file. Must be an - octal value between 0000 and 0777 or a decimal - value between 0 and 511. YAML accepts both - octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This - might be in conflict with other options - that affect the file mode, like fsGroup, - and the result can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file - to map the key to. May not be an absolute - path. May not contain the path element '..'. - May not start with the string '..'. type: string required: - key @@ -5568,235 +2599,92 @@ spec: type: object type: array name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' type: string optional: - description: Specify whether the ConfigMap or its - keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: - description: CSI (Container Storage Interface) represents - ephemeral storage that is handled by certain external - CSI drivers (Beta feature). properties: driver: - description: Driver is the name of the CSI driver - that handles this volume. Consult with your admin - for the correct name as registered in the cluster. type: string fsType: - description: Filesystem type to mount. Ex. "ext4", - "xfs", "ntfs". If not provided, the empty value - is passed to the associated CSI driver which will - determine the default filesystem to apply. type: string nodePublishSecretRef: - description: NodePublishSecretRef is a reference - to the secret object containing sensitive information - to pass to the CSI driver to complete the CSI - NodePublishVolume and NodeUnpublishVolume calls. - This field is optional, and may be empty if no - secret is required. If the secret object contains - more than one secret, all secret references are - passed. properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: Specifies a read-only configuration - for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: VolumeAttributes stores driver-specific - properties that are passed to the CSI driver. - Consult your driver's documentation for supported - values. type: object required: - driver type: object downwardAPI: - description: DownwardAPI represents downward API about - the pod that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created - files by default. Must be a Optional: mode bits - used to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories - within the path are not affected by this setting. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' format: int32 type: integer items: - description: Items is a list of downward API volume - file items: - description: DownwardAPIVolumeFile represents - information to create the file containing the - pod field properties: fieldRef: - description: 'Required: Selects a field of - the pod: only annotations, labels, name - and namespace are supported.' properties: apiVersion: - description: Version of the schema the - FieldPath is written in terms of, defaults - to "v1". type: string fieldPath: - description: Path of the field to select - in the specified API version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be an - octal value between 0000 and 0777 or a decimal - value between 0 and 511. YAML accepts both - octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This - might be in conflict with other options - that affect the file mode, like fsGroup, - and the result can be other mode bits set.' format: int32 type: integer path: - description: 'Required: Path is the relative - path name of the file to be created. Must - not be absolute or contain the ''..'' path. - Must be utf-8 encoded. The first item of - the relative path must not start with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' properties: containerName: - description: 'Container name: required - for volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format - of the exposed resources, defaults to - "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'EmptyDir represents a temporary directory - that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'What type of storage medium should - back this directory. The default is "" which means - to use the node''s default medium. Must be an - empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'Total amount of local storage required - for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage - on memory medium EmptyDir would be the minimum - value between the SizeLimit specified here and - the sum of memory limits of all containers in - a pod. The default is nil which means that the - limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "Ephemeral represents a volume that is - handled by a cluster storage driver. The volume's - lifecycle is tied to the pod that defines it - it - will be created before the pod starts, and deleted - when the pod is removed. \n Use this if: a) the volume - is only needed while the pod runs, b) features of - normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is - specified through a storage class, and d) the storage - driver supports dynamic volume provisioning through - \ a PersistentVolumeClaim (see EphemeralVolumeSource - for more information on the connection between - this volume type and PersistentVolumeClaim). \n - Use PersistentVolumeClaim or one of the vendor-specific - APIs for volumes that persist for longer than the - lifecycle of an individual pod. \n Use CSI for light-weight - local ephemeral volumes if the CSI driver is meant - to be used that way - see the documentation of the - driver for more information. \n A pod can use both - types of ephemeral volumes and persistent volumes - at the same time. \n This is a beta feature and only - available when the GenericEphemeralVolume feature - gate is enabled." properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone - PVC to provision the volume. The pod in which - this EphemeralVolumeSource is embedded will be - the owner of the PVC, i.e. the PVC will be deleted - together with the pod. The name of the PVC will - be `-` where `` - is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too - long). \n An existing PVC with that name that - is not owned by the pod will *not* be used for - the pod to avoid using an unrelated volume by - mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created - PVC is meant to be used by the pod, the PVC has - to updated with an owner reference to the pod - once the pod exists. Normally this should not - be necessary, but it may be useful when manually - reconstructing a broken cluster. \n This field - is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, - must not be nil." properties: metadata: - description: May contain labels and annotations - that will be copied into the PVC when creating - it. No other fields are allowed and will be - rejected during validation. properties: annotations: additionalProperties: @@ -5816,107 +2704,38 @@ spec: type: string type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into - the PVC that gets created from this template. - The same fields as in a PersistentVolumeClaim - are also valid here. properties: accessModes: - description: 'AccessModes contains the desired - access modes the volume should have. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be used to - specify either: * An existing VolumeSnapshot - object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller - can support the specified data source, - it will create a new volume based on the - contents of the specified data source. - If the AnyVolumeDataSource feature gate - is enabled, this field will always have - the same contents as the DataSourceRef - field.' properties: apiGroup: - description: APIGroup is the group for - the resource being referenced. If - APIGroup is not specified, the specified - Kind must be in the core API group. - For any other third-party types, APIGroup - is required. type: string kind: - description: Kind is the type of resource - being referenced type: string name: - description: Name is the name of resource - being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'Specifies the object from - which to populate the volume with data, - if a non-empty volume is desired. This - may be any local object from a non-empty - API group (non core object) or a PersistentVolumeClaim - object. When this field is specified, - volume binding will only succeed if the - type of the specified object matches some - installed volume populator or dynamic - provisioner. This field will replace the - functionality of the DataSource field - and as such if both fields are non-empty, - they must have the same value. For backwards - compatibility, both fields (DataSource - and DataSourceRef) will be set to the - same value automatically if one of them - is empty and the other is non-empty. There - are two important differences between - DataSource and DataSourceRef: * While - DataSource only allows two specific types - of objects, DataSourceRef allows any - non-core object, as well as PersistentVolumeClaim - objects. * While DataSource ignores disallowed - values (dropping them), DataSourceRef preserves - all values, and generates an error if - a disallowed value is specified. (Alpha) - Using this field requires the AnyVolumeDataSource - feature gate to be enabled.' properties: apiGroup: - description: APIGroup is the group for - the resource being referenced. If - APIGroup is not specified, the specified - Kind must be in the core API group. - For any other third-party types, APIGroup - is required. type: string kind: - description: Kind is the type of resource - being referenced type: string name: - description: Name is the name of resource - being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic resources: - description: 'Resources represents the minimum - resources the volume should have. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -5925,9 +2744,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum - amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -5936,49 +2752,18 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the - minimum amount of compute resources - required. If Requests is omitted for - a container, it defaults to Limits - if that is explicitly specified, otherwise - to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: A label query over volumes - to consider for binding. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array @@ -5990,29 +2775,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. type: object type: object + x-kubernetes-map-type: atomic storageClassName: - description: 'Name of the StorageClass required - by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines what type - of volume is required by the claim. Value - of Filesystem is implied when not included - in claim spec. type: string volumeName: - description: VolumeName is the binding reference - to the PersistentVolume backing this claim. type: string type: object required: @@ -6020,272 +2790,127 @@ spec: type: object type: object fc: - description: FC represents a Fibre Channel resource - that is attached to a kubelet's host machine and then - exposed to the pod. properties: fsType: - description: 'Filesystem type to mount. Must be - a filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. TODO: how - do we prevent errors in the filesystem from compromising - the machine' type: string lun: - description: 'Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts.' type: boolean targetWWNs: - description: 'Optional: FC target worldwide names - (WWNs)' items: type: string type: array wwids: - description: 'Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs - and lun must be set, but not both simultaneously.' items: type: string type: array type: object flexVolume: - description: FlexVolume represents a generic volume - resource that is provisioned/attached using an exec - based plugin. properties: driver: - description: Driver is the name of the driver to - use for this volume. type: string fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". The default - filesystem depends on FlexVolume script. type: string options: additionalProperties: type: string - description: 'Optional: Extra command options if - any.' type: object readOnly: - description: 'Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts.' type: boolean secretRef: - description: 'Optional: SecretRef is reference to - the secret object containing sensitive information - to pass to the plugin scripts. This may be empty - if no secret object is specified. If the secret - object contains more than one secret, all secrets - are passed to the plugin scripts.' properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object flocker: - description: Flocker represents a Flocker volume attached - to a kubelet's host machine. This depends on the Flocker - control service being running properties: datasetName: - description: Name of the dataset stored as metadata - -> name on the dataset for Flocker should be considered - as deprecated type: string datasetUUID: - description: UUID of the dataset. This is unique - identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'GCEPersistentDisk represents a GCE Disk - resource that is attached to a kubelet''s host machine - and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'Filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred - to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem - from compromising the machine' type: string partition: - description: 'The partition in the volume that you - want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, - you specify the partition as "1". Similarly, the - volume partition for /dev/sda is "0" (or you can - leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'Unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: - https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'ReadOnly here will force the ReadOnly - setting in VolumeMounts. Defaults to false. More - info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean required: - pdName type: object gitRepo: - description: 'GitRepo represents a git repository at - a particular revision. DEPRECATED: GitRepo is deprecated. - To provision a container with a git repo, mount an - EmptyDir into an InitContainer that clones the repo - using git, then mount the EmptyDir into the Pod''s - container.' properties: directory: - description: Target directory name. Must not contain - or start with '..'. If '.' is supplied, the volume - directory will be the git repository. Otherwise, - if specified, the volume will contain the git - repository in the subdirectory with the given - name. type: string repository: - description: Repository URL type: string revision: - description: Commit hash for the specified revision. type: string required: - repository type: object glusterfs: - description: 'Glusterfs represents a Glusterfs mount - on the host that shares a pod''s lifetime. More info: - https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'EndpointsName is the endpoint name - that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'Path is the Glusterfs volume path. - More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'ReadOnly here will force the Glusterfs - volume to be mounted with read-only permissions. - Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean required: - endpoints - path type: object hostPath: - description: 'HostPath represents a pre-existing file - or directory on the host machine that is directly - exposed to the container. This is generally used for - system agents or other privileged things that are - allowed to see the host machine. Most containers will - NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use - host directory mounts and who can/can not mount host - directories as read/write.' properties: path: - description: 'Path of the directory on the host. - If the path is a symlink, it will follow the link - to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'Type for HostPath Volume Defaults - to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'ISCSI represents an ISCSI Disk resource - that is attached to a kubelet''s host machine and - then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: whether support iSCSI Discovery CHAP - authentication type: boolean chapAuthSession: - description: whether support iSCSI Session CHAP - authentication type: boolean fsType: - description: 'Filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred - to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem - from compromising the machine' type: string initiatorName: - description: Custom iSCSI Initiator Name. If initiatorName - is specified with iscsiInterface simultaneously, - new iSCSI interface : - will be created for the connection. type: string iqn: - description: Target iSCSI Qualified Name. type: string iscsiInterface: - description: iSCSI Interface Name that uses an iSCSI - transport. Defaults to 'default' (tcp). type: string lun: - description: iSCSI Target Lun number. format: int32 type: integer portals: - description: iSCSI Target Portal List. The portal - is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and - 3260). items: type: string type: array readOnly: - description: ReadOnly here will force the ReadOnly - setting in VolumeMounts. Defaults to false. type: boolean secretRef: - description: CHAP Secret for iSCSI target and initiator - authentication properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: iSCSI Target Portal. The Portal is - either an IP or ip_addr:port if the port is other - than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -6293,158 +2918,67 @@ spec: - targetPortal type: object name: - description: 'Volume''s name. Must be a DNS_LABEL and - unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'NFS represents an NFS mount on the host - that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'Path that is exported by the NFS server. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'ReadOnly here will force the NFS export - to be mounted with read-only permissions. Defaults - to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'Server is the hostname or IP address - of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: - path - server type: object persistentVolumeClaim: - description: 'PersistentVolumeClaimVolumeSource represents - a reference to a PersistentVolumeClaim in the same - namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'ClaimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: Will force the ReadOnly setting in - VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: PhotonPersistentDisk represents a PhotonController - persistent disk attached and mounted on kubelets host - machine properties: fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. type: string pdID: - description: ID that identifies Photon Controller - persistent disk type: string required: - pdID type: object portworxVolume: - description: PortworxVolume represents a portworx volume - attached and mounted on kubelets host machine properties: fsType: - description: FSType represents the filesystem type - to mount Must be a filesystem type supported by - the host operating system. Ex. "ext4", "xfs". - Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. type: boolean volumeID: - description: VolumeID uniquely identifies a Portworx - volume type: string required: - volumeID type: object projected: - description: Items for all in one resources secrets, - configmaps, and downward API properties: defaultMode: - description: Mode bits used to set permissions on - created files by default. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal - values, JSON requires decimal values for mode - bits. Directories within the path are not affected - by this setting. This might be in conflict with - other options that affect the file mode, like - fsGroup, and the result can be other mode bits - set. format: int32 type: integer sources: - description: list of volume projections items: - description: Projection that may be projected - along with other supported volume types properties: configMap: - description: information about the configMap - data to project properties: items: - description: If unspecified, each key-value - pair in the Data field of the referenced - ConfigMap will be projected into the - volume as a file whose name is the key - and content is the value. If specified, - the listed keys will be projected into - the specified paths, and unlisted keys - will not be present. If a key is specified - which is not present in the ConfigMap, - the volume setup will error unless it - is marked optional. Paths must be relative - and may not contain the '..' path or - start with '..'. items: - description: Maps a string key to a - path within a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits - used to set permissions on this - file. Must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, - JSON requires decimal values for - mode bits. If not specified, the - volume defaultMode will be used. - This might be in conflict with - other options that affect the - file mode, like fsGroup, and the - result can be other mode bits - set.' format: int32 type: integer path: - description: The relative path of - the file to map the key to. May - not be an absolute path. May not - contain the path element '..'. - May not start with the string - '..'. type: string required: - key @@ -6452,156 +2986,63 @@ spec: type: object type: array name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: - description: information about the downwardAPI - data to project properties: items: - description: Items is a list of DownwardAPIVolume - file items: - description: DownwardAPIVolumeFile represents - information to create the file containing - the pod field properties: fieldRef: - description: 'Required: Selects - a field of the pod: only annotations, - labels, name and namespace are - supported.' properties: apiVersion: - description: Version of the - schema the FieldPath is written - in terms of, defaults to "v1". type: string fieldPath: - description: Path of the field - to select in the specified - API version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits - used to set permissions on this - file, must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, - JSON requires decimal values for - mode bits. If not specified, the - volume defaultMode will be used. - This might be in conflict with - other options that affect the - file mode, like fsGroup, and the - result can be other mode bits - set.' format: int32 type: integer path: - description: 'Required: Path is the - relative path name of the file - to be created. Must not be absolute - or contain the ''..'' path. Must - be utf-8 encoded. The first item - of the relative path must not - start with ''..''' type: string resourceFieldRef: - description: 'Selects a resource - of the container: only resources - limits and requests (limits.cpu, - limits.memory, requests.cpu and - requests.memory) are currently - supported.' properties: containerName: - description: 'Container name: - required for volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output - format of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource - to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object secret: - description: information about the secret - data to project properties: items: - description: If unspecified, each key-value - pair in the Data field of the referenced - Secret will be projected into the volume - as a file whose name is the key and - content is the value. If specified, - the listed keys will be projected into - the specified paths, and unlisted keys - will not be present. If a key is specified - which is not present in the Secret, - the volume setup will error unless it - is marked optional. Paths must be relative - and may not contain the '..' path or - start with '..'. items: - description: Maps a string key to a - path within a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits - used to set permissions on this - file. Must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, - JSON requires decimal values for - mode bits. If not specified, the - volume defaultMode will be used. - This might be in conflict with - other options that affect the - file mode, like fsGroup, and the - result can be other mode bits - set.' format: int32 type: integer path: - description: The relative path of - the file to map the key to. May - not be an absolute path. May not - contain the path element '..'. - May not start with the string - '..'. type: string required: - key @@ -6609,47 +3050,19 @@ spec: type: object type: array name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: - description: information about the serviceAccountToken - data to project properties: audience: - description: Audience is the intended - audience of the token. A recipient of - a token must identify itself with an - identifier specified in the audience - of the token, and otherwise should reject - the token. The audience defaults to - the identifier of the apiserver. type: string expirationSeconds: - description: ExpirationSeconds is the - requested duration of validity of the - service account token. As the token - approaches expiration, the kubelet volume - plugin will proactively rotate the service - account token. The kubelet will start - trying to rotate the token if the token - is older than 80 percent of its time - to live or if the token is older than - 24 hours.Defaults to 1 hour and must - be at least 10 minutes. format: int64 type: integer path: - description: Path is the path relative - to the mount point of the file to project - the token into. type: string required: - path @@ -6658,155 +3071,76 @@ spec: type: array type: object quobyte: - description: Quobyte represents a Quobyte mount on the - host that shares a pod's lifetime properties: group: - description: Group to map volume access to Default - is no group type: string readOnly: - description: ReadOnly here will force the Quobyte - volume to be mounted with read-only permissions. - Defaults to false. type: boolean registry: - description: Registry represents a single or multiple - Quobyte Registry services specified as a string - as host:port pair (multiple entries are separated - with commas) which acts as the central registry - for volumes type: string tenant: - description: Tenant owning the given Quobyte volume - in the Backend Used with dynamically provisioned - Quobyte volumes, value is set by the plugin type: string user: - description: User to map volume access to Defaults - to serivceaccount user type: string volume: - description: Volume is a string that references - an already created Quobyte volume by name. type: string required: - registry - volume type: object rbd: - description: 'RBD represents a Rados Block Device mount - on the host that shares a pod''s lifetime. More info: - https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'Filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred - to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem - from compromising the machine' type: string image: - description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'Keyring is the path to key ring for - RBDUser. Default is /etc/ceph/keyring. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'A collection of Ceph monitors. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'The rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'ReadOnly here will force the ReadOnly - setting in VolumeMounts. Defaults to false. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'SecretRef is name of the authentication - secret for RBDUser. If provided overrides keyring. - Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic user: - description: 'The rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: ScaleIO represents a ScaleIO persistent - volume attached and mounted on Kubernetes nodes. properties: fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Default is - "xfs". type: string gateway: - description: The host address of the ScaleIO API - Gateway. type: string protectionDomain: - description: The name of the ScaleIO Protection - Domain for the configured storage. type: string readOnly: - description: Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: SecretRef references to the secret - for ScaleIO user and other sensitive information. - If this is not provided, Login operation will - fail. properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic sslEnabled: - description: Flag to enable/disable SSL communication - with Gateway, default false type: boolean storageMode: - description: Indicates whether the storage for a - volume should be ThickProvisioned or ThinProvisioned. - Default is ThinProvisioned. type: string storagePool: - description: The ScaleIO Storage Pool associated - with the protection domain. type: string system: - description: The name of the storage system as configured - in ScaleIO. type: string volumeName: - description: The name of a volume already created - in the ScaleIO system that is associated with - this volume source. type: string required: - gateway @@ -6814,59 +3148,19 @@ spec: - system type: object secret: - description: 'Secret represents a secret that should - populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'Optional: mode bits used to set permissions - on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts both octal and - decimal values, JSON requires decimal values for - mode bits. Defaults to 0644. Directories within - the path are not affected by this setting. This - might be in conflict with other options that affect - the file mode, like fsGroup, and the result can - be other mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value pair - in the Data field of the referenced Secret will - be projected into the volume as a file whose name - is the key and content is the value. If specified, - the listed keys will be projected into the specified - paths, and unlisted keys will not be present. - If a key is specified which is not present in - the Secret, the volume setup will error unless - it is marked optional. Paths must be relative - and may not contain the '..' path or start with - '..'. items: - description: Maps a string key to a path within - a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits used to - set permissions on this file. Must be an - octal value between 0000 and 0777 or a decimal - value between 0 and 511. YAML accepts both - octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This - might be in conflict with other options - that affect the file mode, like fsGroup, - and the result can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file - to map the key to. May not be an absolute - path. May not contain the path element '..'. - May not start with the string '..'. type: string required: - key @@ -6874,78 +3168,36 @@ spec: type: object type: array optional: - description: Specify whether the Secret or its keys - must be defined type: boolean secretName: - description: 'Name of the secret in the pod''s namespace - to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: StorageOS represents a StorageOS volume - attached and mounted on Kubernetes nodes. properties: fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. type: string readOnly: - description: Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: SecretRef specifies the secret to use - for obtaining the StorageOS API credentials. If - not specified, default values will be attempted. properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: VolumeName is the human-readable name - of the StorageOS volume. Volume names are only - unique within a namespace. type: string volumeNamespace: - description: VolumeNamespace specifies the scope - of the volume within StorageOS. If no namespace - is specified then the Pod's namespace will be - used. This allows the Kubernetes name scoping - to be mirrored within StorageOS for tighter integration. - Set VolumeName to any name to override the default - behaviour. Set to "default" if you are not using - namespaces within StorageOS. Namespaces that do - not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: - description: VsphereVolume represents a vSphere volume - attached and mounted on kubelets host machine properties: fsType: - description: Filesystem type to mount. Must be a - filesystem type supported by the host operating - system. Ex. "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. type: string storagePolicyID: - description: Storage Policy Based Management (SPBM) - profile ID associated with the StoragePolicyName. type: string storagePolicyName: - description: Storage Policy Based Management (SPBM) - profile name. type: string volumePath: - description: Path that identifies vSphere volume - vmdk type: string required: - volumePath @@ -6959,52 +3211,29 @@ spec: type: object type: object updateStrategy: - description: updateStrategy indicates the StatefulSetUpdateStrategy - that will be employed to update Pods in the StatefulSet when a revision - is made to Template. properties: rollingUpdate: - description: RollingUpdate is used to communicate parameters when - Type is RollingUpdateStatefulSetStrategyType. properties: + maxUnavailable: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true partition: - description: Partition indicates the ordinal at which the - StatefulSet should be partitioned. Default value is 0. format: int32 type: integer type: object type: - description: Type indicates the type of the StatefulSetUpdateStrategy. - Default is RollingUpdate. type: string type: object volumeClaimTemplates: - description: 'volumeClaimTemplates is a list of claims that pods are - allowed to reference. The StatefulSet controller is responsible - for mapping network identities to claims in a way that maintains - the identity of a pod. Every claim in this list must have at least - one matching (by name) volumeMount in one container in the template. - A claim in this list takes precedence over any volumes in the template, - with the same name. TODO: Define the behavior if a claim already - exists with the same name.' items: - description: PersistentVolumeClaim is a user's request for and claim - to a persistent volume properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' properties: annotations: additionalProperties: @@ -7024,82 +3253,38 @@ spec: type: string type: object spec: - description: 'Spec defines the desired characteristics of a - volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the desired access modes - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be used to specify either: - * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified data - source, it will create a new volume based on the contents - of the specified data source. If the AnyVolumeDataSource - feature gate is enabled, this field will always have the - same contents as the DataSourceRef field.' properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, the - specified Kind must be in the core API group. For - any other third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced type: string name: - description: Name is the name of resource being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'Specifies the object from which to populate - the volume with data, if a non-empty volume is desired. - This may be any local object from a non-empty API group - (non core object) or a PersistentVolumeClaim object. When - this field is specified, volume binding will only succeed - if the type of the specified object matches some installed - volume populator or dynamic provisioner. This field will - replace the functionality of the DataSource field and - as such if both fields are non-empty, they must have the - same value. For backwards compatibility, both fields (DataSource - and DataSourceRef) will be set to the same value automatically - if one of them is empty and the other is non-empty. There - are two important differences between DataSource and DataSourceRef: - * While DataSource only allows two specific types of objects, - DataSourceRef allows any non-core object, as well as - PersistentVolumeClaim objects. * While DataSource ignores - disallowed values (dropping them), DataSourceRef preserves - all values, and generates an error if a disallowed value - is specified. (Alpha) Using this field requires the - AnyVolumeDataSource feature gate to be enabled.' properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, the - specified Kind must be in the core API group. For - any other third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced type: string name: - description: Name is the name of resource being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic resources: - description: 'Resources represents the minimum resources - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -7108,8 +3293,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of - compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -7118,41 +3301,18 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is omitted - for a container, it defaults to Limits if that is - explicitly specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: A label query over volumes to consider for - binding. properties: matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. properties: key: - description: key is the label key that the selector - applies to. type: string operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, - NotIn, Exists and DoesNotExist. type: string values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists - or DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. items: type: string type: array @@ -7164,37 +3324,30 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. - A single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field - is "key", the operator is "In", and the values array - contains only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic storageClassName: - description: 'Name of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines what type of volume is required - by the claim. Value of Filesystem is implied when not - included in claim spec. type: string volumeName: - description: VolumeName is the binding reference to the - PersistentVolume backing this claim. type: string type: object status: - description: 'Status represents the current information/status - of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the actual access modes - the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object capacity: additionalProperties: anyOf: @@ -7202,42 +3355,23 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: Represents the actual resources of the underlying - volume. type: object conditions: - description: Current Condition of persistent volume claim. - If underlying persistent volume is being resized then - the Condition will be set to 'ResizeStarted'. items: - description: PersistentVolumeClaimCondition contails details - about state of pvc properties: lastProbeTime: - description: Last time we probed the condition. format: date-time type: string lastTransitionTime: - description: Last time the condition transitioned - from one status to another. format: date-time type: string message: - description: Human-readable message indicating details - about last transition. type: string reason: - description: Unique, this should be a short, machine - understandable string that gives the reason for - condition's last transition. If it reports "ResizeStarted" - that means the underlying persistent volume is being - resized. type: string status: type: string type: - description: PersistentVolumeClaimConditionType is - a valid value of PersistentVolumeClaimCondition.Type type: string required: - status @@ -7245,7 +3379,8 @@ spec: type: object type: array phase: - description: Phase represents the current phase of PersistentVolumeClaim. + type: string + resizeStatus: type: string type: object type: object @@ -7256,16 +3391,3322 @@ spec: - template type: object status: - description: ReplicasetTemplateStatus defines the observed state of ReplicasetTemplate type: object type: object served: true storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + minReadySeconds: + default: 0 + format: int32 + type: integer + podTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: atomic + os: + properties: + name: + type: string + required: + - name + type: object + overhead: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + required: + - conditionType + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + required: + - containers + type: object + type: object + replicas: + default: 1 + format: int32 + type: integer + volumeClaimTemplates: + items: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + type: array + phase: + type: string + resizeStatus: + type: string + type: object + type: object + type: array + type: object + served: true + storage: false diff --git a/config/crd/bases/tarantool.io_roles.yaml b/config/crd/bases/tarantool.io_roles.yaml index 19c6bada..ce522bf1 100644 --- a/config/crd/bases/tarantool.io_roles.yaml +++ b/config/crd/bases/tarantool.io_roles.yaml @@ -1,10 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.10.0 creationTimestamp: null name: roles.tarantool.io spec: @@ -19,55 +18,28 @@ spec: - name: v1alpha1 schema: openAPIV3Schema: - description: Role is the Schema for the roles API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: - description: RoleSpec defines the desired state of Role properties: numReplicasets: - description: NumReplicasets is a number of StatefulSets (Tarantol - replicasets) created under this Role format: int32 type: integer selector: - description: Selector is a LabelSelector to find ReplicasetTemplate - resources from which StatefulSet created properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector requirement is a selector that - contains values, a key, and an operator that relates the key - and values. properties: key: - description: key is the label key that the selector applies - to. type: string operator: - description: operator represents a key's relationship to - a set of values. Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of string values. If the - operator is In or NotIn, the values array must be non-empty. - If the operator is Exists or DoesNotExist, the values - array must be empty. This array is replaced during a strategic - merge patch. items: type: string type: array @@ -79,28 +51,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single - {key,value} in the matchLabels map is equivalent to an element - of matchExpressions, whose key field is "key", the operator - is "In", and the values array contains only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic storageTemplate: - description: ReplicasetTemplate is the Schema for the replicasettemplates - API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: properties: @@ -122,74 +80,35 @@ spec: type: string type: object spec: - description: A StatefulSetSpec is the specification of a StatefulSet. properties: minReadySeconds: - description: Minimum number of seconds for which a newly created - pod should be ready without any of its container crashing - for it to be considered available. Defaults to 0 (pod will - be considered available as soon as it is ready) This is - an alpha field and requires enabling StatefulSetMinReadySeconds - feature gate. format: int32 type: integer + persistentVolumeClaimRetentionPolicy: + properties: + whenDeleted: + type: string + whenScaled: + type: string + type: object podManagementPolicy: - description: podManagementPolicy controls how pods are created - during initial scale up, when replacing pods on nodes, or - when scaling down. The default policy is `OrderedReady`, - where pods are created in increasing order (pod-0, then - pod-1, etc) and the controller will wait until each pod - is ready before continuing. When scaling down, the pods - are removed in the opposite order. The alternative policy - is `Parallel` which will create pods in parallel to match - the desired scale without waiting, and on scale down will - delete all pods at once. type: string replicas: - description: 'replicas is the desired number of replicas of - the given Template. These are replicas in the sense that - they are instantiations of the same Template, but individual - replicas also have a consistent identity. If unspecified, - defaults to 1. TODO: Consider a rename of this field.' format: int32 type: integer revisionHistoryLimit: - description: revisionHistoryLimit is the maximum number of - revisions that will be maintained in the StatefulSet's revision - history. The revision history consists of all revisions - not represented by a currently applied StatefulSetSpec version. - The default value is 10. format: int32 type: integer selector: - description: 'selector is a label query over pods that should - match the replica count. It must match the pod template''s - labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' properties: matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. properties: key: - description: key is the label key that the selector - applies to. type: string operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, NotIn, - Exists and DoesNotExist. type: string values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists or - DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. items: type: string type: array @@ -201,32 +120,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. - A single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field is - "key", the operator is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic serviceName: - description: 'serviceName is the name of the service that - governs this StatefulSet. This service must exist before - the StatefulSet, and is responsible for the network identity - of the set. Pods get DNS/hostnames that follow the pattern: - pod-specific-string.serviceName.default.svc.cluster.local - where "pod-specific-string" is managed by the StatefulSet - controller.' type: string template: - description: template is the object that describes the pod - that will be created if insufficient replicas are detected. - Each pod stamped out by the StatefulSet will fulfill this - Template, but have a unique identity from the rest of the - StatefulSet. properties: metadata: - description: 'Standard object''s metadata. More info: - https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' properties: annotations: additionalProperties: @@ -246,87 +147,27 @@ spec: type: string type: object spec: - description: 'Specification of the desired behavior of - the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' properties: activeDeadlineSeconds: - description: Optional duration in seconds the pod - may be active on the node relative to StartTime - before the system will actively try to mark it failed - and kill associated containers. Value must be a - positive integer. format: int64 type: integer affinity: - description: If specified, the pod's scheduling constraints properties: nodeAffinity: - description: Describes node affinity scheduling - rules for the pod. properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to - schedule pods to nodes that satisfy the - affinity expressions specified by this field, - but it may choose a node that violates one - or more of the expressions. The node that - is most preferred is the one with the greatest - sum of weights, i.e. for each node that - meets all of the scheduling requirements - (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum - by iterating through the elements of this - field and adding "weight" to the sum if - the node matches the corresponding matchExpressions; - the node(s) with the highest sum are the - most preferred. items: - description: An empty preferred scheduling - term matches all objects with implicit - weight 0 (i.e. it's a no-op). A null preferred - scheduling term matches no objects (i.e. - is also a no-op). properties: preference: - description: A node selector term, associated - with the corresponding weight. properties: matchExpressions: - description: A list of node selector - requirements by node's labels. items: - description: A node selector requirement - is a selector that contains - values, a key, and an operator - that relates the key and values. properties: key: - description: The label key - that the selector applies - to. type: string operator: - description: Represents a - key's relationship to a - set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string - values. If the operator - is In or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the values - array must be empty. If - the operator is Gt or Lt, - the values array must have - a single element, which - will be interpreted as an - integer. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -336,41 +177,13 @@ spec: type: object type: array matchFields: - description: A list of node selector - requirements by node's fields. items: - description: A node selector requirement - is a selector that contains - values, a key, and an operator - that relates the key and values. properties: key: - description: The label key - that the selector applies - to. type: string operator: - description: Represents a - key's relationship to a - set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string - values. If the operator - is In or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the values - array must be empty. If - the operator is Gt or Lt, - the values array must have - a single element, which - will be interpreted as an - integer. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -380,10 +193,8 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic weight: - description: Weight associated with - matching the corresponding nodeSelectorTerm, - in the range 1-100. format: int32 type: integer required: @@ -392,60 +203,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements - specified by this field are not met at scheduling - time, the pod will not be scheduled onto - the node. If the affinity requirements specified - by this field cease to be met at some point - during pod execution (e.g. due to an update), - the system may or may not try to eventually - evict the pod from its node. properties: nodeSelectorTerms: - description: Required. A list of node - selector terms. The terms are ORed. items: - description: A null or empty node selector - term matches no objects. The requirements - of them are ANDed. The TopologySelectorTerm - type implements a subset of the NodeSelectorTerm. properties: matchExpressions: - description: A list of node selector - requirements by node's labels. items: - description: A node selector requirement - is a selector that contains - values, a key, and an operator - that relates the key and values. properties: key: - description: The label key - that the selector applies - to. type: string operator: - description: Represents a - key's relationship to a - set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string - values. If the operator - is In or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the values - array must be empty. If - the operator is Gt or Lt, - the values array must have - a single element, which - will be interpreted as an - integer. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -455,41 +224,13 @@ spec: type: object type: array matchFields: - description: A list of node selector - requirements by node's fields. items: - description: A node selector requirement - is a selector that contains - values, a key, and an operator - that relates the key and values. properties: key: - description: The label key - that the selector applies - to. type: string operator: - description: Represents a - key's relationship to a - set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. type: string values: - description: An array of string - values. If the operator - is In or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the values - array must be empty. If - the operator is Gt or Lt, - the values array must have - a single element, which - will be interpreted as an - integer. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -499,84 +240,30 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic type: array required: - nodeSelectorTerms type: object + x-kubernetes-map-type: atomic type: object podAffinity: - description: Describes pod affinity scheduling - rules (e.g. co-locate this pod in the same node, - zone, etc. as some other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to - schedule pods to nodes that satisfy the - affinity expressions specified by this field, - but it may choose a node that violates one - or more of the expressions. The node that - is most preferred is the one with the greatest - sum of weights, i.e. for each node that - meets all of the scheduling requirements - (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum - by iterating through the elements of this - field and adding "weight" to the sum if - the node has pods which matches the corresponding - podAffinityTerm; the node(s) with the highest - sum are the most preferred. items: - description: The weights of all of the matched - WeightedPodAffinityTerm fields are added - per-node to find the most preferred node(s) properties: podAffinityTerm: - description: Required. A pod affinity - term, associated with the corresponding - weight. properties: labelSelector: - description: A label query over - a set of resources, in this case - pods. properties: matchExpressions: - description: matchExpressions - is a list of label selector - requirements. The requirements - are ANDed. items: - description: A label selector - requirement is a selector - that contains values, a - key, and an operator that - relates the key and values. properties: key: - description: key is the - label key that the selector - applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is - an array of string values. - If the operator is In - or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the - values array must be - empty. This array is - replaced during a strategic - merge patch. items: type: string type: array @@ -588,70 +275,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is - a map of {key,value} pairs. - A single {key,value} in the - matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", - the operator is "In", and - the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over - the set of namespaces that the - term applies to. The term is applied - to the union of the namespaces - selected by this field and the - ones listed in the namespaces - field. null selector and null - or empty namespaces list means - "this pod's namespace". An empty - selector ({}) matches all namespaces. - This field is beta-level and is - only honored when PodAffinityNamespaceSelector - feature is enabled. properties: matchExpressions: - description: matchExpressions - is a list of label selector - requirements. The requirements - are ANDed. items: - description: A label selector - requirement is a selector - that contains values, a - key, and an operator that - relates the key and values. properties: key: - description: key is the - label key that the selector - applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is - an array of string values. - If the operator is In - or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the - values array must be - empty. This array is - replaced during a strategic - merge patch. items: type: string type: array @@ -663,51 +299,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is - a map of {key,value} pairs. - A single {key,value} in the - matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", - the operator is "In", and - the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies - a static list of namespace names - that the term applies to. The - term is applied to the union of - the namespaces listed in this - field and the ones selected by - namespaceSelector. null or empty - namespaces list and null namespaceSelector - means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be - co-located (affinity) or not co-located - (anti-affinity) with the pods - matching the labelSelector in - the specified namespaces, where - co-located is defined as running - on a node whose value of the label - with key topologyKey matches that - of any node on which any of the - selected pods is running. Empty - topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with - matching the corresponding podAffinityTerm, - in the range 1-100. format: int32 type: integer required: @@ -716,67 +320,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements - specified by this field are not met at scheduling - time, the pod will not be scheduled onto - the node. If the affinity requirements specified - by this field cease to be met at some point - during pod execution (e.g. due to a pod - label update), the system may or may not - try to eventually evict the pod from its - node. When there are multiple elements, - the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all - terms must be satisfied. items: - description: Defines a set of pods (namely - those matching the labelSelector relative - to the given namespace(s)) that this pod - should be co-located (affinity) or not - co-located (anti-affinity) with, where - co-located is defined as running on a - node whose value of the label with key - matches that of any node - on which a pod of the set of pods is running properties: labelSelector: - description: A label query over a set - of resources, in this case pods. properties: matchExpressions: - description: matchExpressions is - a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector - requirement is a selector that - contains values, a key, and - an operator that relates the - key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to - a set of values. Valid operators - are In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is an - array of string values. - If the operator is In or - NotIn, the values array - must be non-empty. If the - operator is Exists or DoesNotExist, - the values array must be - empty. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -788,65 +343,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map - of {key,value} pairs. A single - {key,value} in the matchLabels - map is equivalent to an element - of matchExpressions, whose key - field is "key", the operator is - "In", and the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the - set of namespaces that the term applies - to. The term is applied to the union - of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty - namespaces list means "this pod's - namespace". An empty selector ({}) - matches all namespaces. This field - is beta-level and is only honored - when PodAffinityNamespaceSelector - feature is enabled. properties: matchExpressions: - description: matchExpressions is - a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector - requirement is a selector that - contains values, a key, and - an operator that relates the - key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to - a set of values. Valid operators - are In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is an - array of string values. - If the operator is In or - NotIn, the values array - must be non-empty. If the - operator is Exists or DoesNotExist, - the values array must be - empty. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -858,40 +367,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map - of {key,value} pairs. A single - {key,value} in the matchLabels - map is equivalent to an element - of matchExpressions, whose key - field is "key", the operator is - "In", and the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a - static list of namespace names that - the term applies to. The term is applied - to the union of the namespaces listed - in this field and the ones selected - by namespaceSelector. null or empty - namespaces list and null namespaceSelector - means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where - co-located is defined as running on - a node whose value of the label with - key topologyKey matches that of any - node on which any of the selected - pods is running. Empty topologyKey - is not allowed. type: string required: - topologyKey @@ -899,78 +382,22 @@ spec: type: array type: object podAntiAffinity: - description: Describes pod anti-affinity scheduling - rules (e.g. avoid putting this pod in the same - node, zone, etc. as some other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to - schedule pods to nodes that satisfy the - anti-affinity expressions specified by this - field, but it may choose a node that violates - one or more of the expressions. The node - that is most preferred is the one with the - greatest sum of weights, i.e. for each node - that meets all of the scheduling requirements - (resource request, requiredDuringScheduling - anti-affinity expressions, etc.), compute - a sum by iterating through the elements - of this field and adding "weight" to the - sum if the node has pods which matches the - corresponding podAffinityTerm; the node(s) - with the highest sum are the most preferred. items: - description: The weights of all of the matched - WeightedPodAffinityTerm fields are added - per-node to find the most preferred node(s) properties: podAffinityTerm: - description: Required. A pod affinity - term, associated with the corresponding - weight. properties: labelSelector: - description: A label query over - a set of resources, in this case - pods. properties: matchExpressions: - description: matchExpressions - is a list of label selector - requirements. The requirements - are ANDed. items: - description: A label selector - requirement is a selector - that contains values, a - key, and an operator that - relates the key and values. properties: key: - description: key is the - label key that the selector - applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is - an array of string values. - If the operator is In - or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the - values array must be - empty. This array is - replaced during a strategic - merge patch. items: type: string type: array @@ -982,70 +409,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is - a map of {key,value} pairs. - A single {key,value} in the - matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", - the operator is "In", and - the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over - the set of namespaces that the - term applies to. The term is applied - to the union of the namespaces - selected by this field and the - ones listed in the namespaces - field. null selector and null - or empty namespaces list means - "this pod's namespace". An empty - selector ({}) matches all namespaces. - This field is beta-level and is - only honored when PodAffinityNamespaceSelector - feature is enabled. properties: matchExpressions: - description: matchExpressions - is a list of label selector - requirements. The requirements - are ANDed. items: - description: A label selector - requirement is a selector - that contains values, a - key, and an operator that - relates the key and values. properties: key: - description: key is the - label key that the selector - applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is - an array of string values. - If the operator is In - or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the - values array must be - empty. This array is - replaced during a strategic - merge patch. items: type: string type: array @@ -1057,51 +433,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is - a map of {key,value} pairs. - A single {key,value} in the - matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", - the operator is "In", and - the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies - a static list of namespace names - that the term applies to. The - term is applied to the union of - the namespaces listed in this - field and the ones selected by - namespaceSelector. null or empty - namespaces list and null namespaceSelector - means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be - co-located (affinity) or not co-located - (anti-affinity) with the pods - matching the labelSelector in - the specified namespaces, where - co-located is defined as running - on a node whose value of the label - with key topologyKey matches that - of any node on which any of the - selected pods is running. Empty - topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with - matching the corresponding podAffinityTerm, - in the range 1-100. format: int32 type: integer required: @@ -1110,67 +454,18 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements - specified by this field are not met at scheduling - time, the pod will not be scheduled onto - the node. If the anti-affinity requirements - specified by this field cease to be met - at some point during pod execution (e.g. - due to a pod label update), the system may - or may not try to eventually evict the pod - from its node. When there are multiple elements, - the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all - terms must be satisfied. items: - description: Defines a set of pods (namely - those matching the labelSelector relative - to the given namespace(s)) that this pod - should be co-located (affinity) or not - co-located (anti-affinity) with, where - co-located is defined as running on a - node whose value of the label with key - matches that of any node - on which a pod of the set of pods is running properties: labelSelector: - description: A label query over a set - of resources, in this case pods. properties: matchExpressions: - description: matchExpressions is - a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector - requirement is a selector that - contains values, a key, and - an operator that relates the - key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to - a set of values. Valid operators - are In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is an - array of string values. - If the operator is In or - NotIn, the values array - must be non-empty. If the - operator is Exists or DoesNotExist, - the values array must be - empty. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -1182,65 +477,19 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map - of {key,value} pairs. A single - {key,value} in the matchLabels - map is equivalent to an element - of matchExpressions, whose key - field is "key", the operator is - "In", and the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the - set of namespaces that the term applies - to. The term is applied to the union - of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty - namespaces list means "this pod's - namespace". An empty selector ({}) - matches all namespaces. This field - is beta-level and is only honored - when PodAffinityNamespaceSelector - feature is enabled. properties: matchExpressions: - description: matchExpressions is - a list of label selector requirements. - The requirements are ANDed. items: - description: A label selector - requirement is a selector that - contains values, a key, and - an operator that relates the - key and values. properties: key: - description: key is the label - key that the selector applies - to. type: string operator: - description: operator represents - a key's relationship to - a set of values. Valid operators - are In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is an - array of string values. - If the operator is In or - NotIn, the values array - must be non-empty. If the - operator is Exists or DoesNotExist, - the values array must be - empty. This array is replaced - during a strategic merge - patch. items: type: string type: array @@ -1252,40 +501,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map - of {key,value} pairs. A single - {key,value} in the matchLabels - map is equivalent to an element - of matchExpressions, whose key - field is "key", the operator is - "In", and the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a - static list of namespace names that - the term applies to. The term is applied - to the union of the namespaces listed - in this field and the ones selected - by namespaceSelector. null or empty - namespaces list and null namespaceSelector - means "this pod's namespace" items: type: string type: array topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where - co-located is defined as running on - a node whose value of the label with - key topologyKey matches that of any - node on which any of the selected - pods is running. Empty topologyKey - is not allowed. type: string required: - topologyKey @@ -1294,305 +517,130 @@ spec: type: object type: object automountServiceAccountToken: - description: AutomountServiceAccountToken indicates - whether a service account token should be automatically - mounted. type: boolean containers: - description: List of containers belonging to the pod. - Containers cannot currently be added or removed. - There must be at least one container in a Pod. Cannot - be updated. items: - description: A single application container that - you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The - docker image''s CMD is used if this is not - provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. - If a variable cannot be resolved, the reference - in the input string will be unchanged. Double - $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal - "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed - within a shell. The docker image''s ENTRYPOINT - is used if this is not provided. Variable - references $(VAR_NAME) are expanded using - the container''s environment. If a variable - cannot be resolved, the reference in the input - string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to - set in the container. Cannot be updated. items: - description: EnvVar represents an environment - variable present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined - environment variables in the container - and any service environment variables. - If a variable cannot be resolved, the - reference in the input string will be - unchanged. Double $$ are reduced to - a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Defaults to "".' type: string valueFrom: - description: Source for the environment - variable's value. Cannot be used if - value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - ConfigMap or its key must be - defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the - pod: supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema - the FieldPath is written in - terms of, defaults to "v1". type: string fieldPath: - description: Path of the field - to select in the specified API - version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of - the container: only resources limits - and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: - required for volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output - format of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource - to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret - in the pod's namespace properties: key: - description: The key of the secret - to select from. Must be a valid - secret key. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - Secret or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined - within a source must be a C_IDENTIFIER. All - invalid keys will be reported as an event - when the container is starting. When a key - exists in multiple sources, the value associated - with the last source will take precedence. - Values defined by an Env with a duplicate - key will take precedence. Cannot be updated. items: - description: EnvFromSource represents the - source of a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to - prepend to each key in the ConfigMap. - Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: - https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level - config management to default or override container - images in workload controllers like Deployments - and StatefulSets.' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, - Never, IfNotPresent. Defaults to Always if - :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Actions that the management system - should take in response to container lifecycle - events. Cannot be updated. properties: postStart: - description: 'PostStart is called immediately - after a container is created. If the handler - fails, the container is terminated and - restarted according to its restart policy. - Other management of the container blocks - until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -1600,116 +648,49 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately - before a container is terminated due to - an API request or management event such - as liveness/startup probe failure, preemption, - resource contention, etc. The handler - is not called if the container crashes - or exits. The reason for termination is - passed to the handler. The Pod''s termination - grace period countdown begins before the - PreStop hooked is executed. Regardless - of the outcome of the handler, the container - will eventually terminate within the Pod''s - termination grace period. Other management - of the container blocks until the hook - completes or until the termination grace - period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -1717,44 +698,25 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -1762,64 +724,37 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. - Container will be restarted if the probe fails. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -1827,147 +762,62 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the container specified - as a DNS_LABEL. Each container in a pod must - have a unique name (DNS_LABEL). Cannot be - updated. type: string ports: - description: List of ports to expose from the - container. Exposing a port here gives the - system additional information about the network - connections a container uses, but is primarily - informational. Not specifying a port here - DOES NOT prevent that port from being exposed. - Any port which is listening on the default - "0.0.0.0" address inside a container will - be accessible from the network. Cannot be - updated. items: - description: ContainerPort represents a network - port in a single container. properties: containerPort: - description: Number of port to expose - on the pod's IP address. This must be - a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the - external port to. type: string hostPort: - description: Number of port to expose - on the host. If specified, this must - be a valid port number, 0 < x < 65536. - If HostNetwork is specified, this must - match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be - an IANA_SVC_NAME and unique within the - pod. Each named port in a pod must have - a unique name. Name for the port that - can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be - UDP, TCP, or SCTP. Defaults to "TCP". type: string required: - containerPort @@ -1978,65 +828,37 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service - readiness. Container will be removed from - service endpoints if the probe fails. Cannot - be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -2044,100 +866,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: 'Compute Resources required by - this container. Cannot be updated. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' properties: limits: additionalProperties: @@ -2146,9 +914,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum - amount of compute resources allowed. More - info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -2157,275 +922,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum - amount of compute resources required. - If Requests is omitted for a container, - it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'SecurityContext defines the security - options the container should be run with. - If set, the fields of SecurityContext override - the equivalent fields of PodSecurityContext. - More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges - than its parent process. This bool directly - controls if the no_new_privs flag will - be set on the container process. AllowPrivilegeEscalation - is true always when the container is: - 1) run as Privileged 2) has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop - when running containers. Defaults to the - default set of capabilities granted by - the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array type: object privileged: - description: Run container in privileged - mode. Processes in privileged containers - are essentially equivalent to root on - the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type - of proc mount to use for the containers. - The default is DefaultProcMount which - uses the container runtime defaults for - readonly paths and masked paths. This - requires the ProcMountType feature flag - to be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has - a read-only root filesystem. Default is - false. type: boolean runAsGroup: - description: The GID to run the entrypoint - of the container process. Uses runtime - default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container - must run as a non-root user. If true, - the Kubelet will validate the image at - runtime to ensure that it does not run - as UID 0 (root) and fail to start the - container if it does. If unset or false, - no such validation will be performed. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint - of the container process. Defaults to - user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied - to the container. If unspecified, the - container runtime will allocate a random - SELinux context for each container. May - also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. properties: level: - description: Level is SELinux level - label that applies to the container. type: string role: - description: Role is a SELinux role - label that applies to the container. type: string type: - description: Type is a SELinux type - label that applies to the container. type: string user: - description: User is a SELinux user - label that applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use - by this container. If seccomp options - are provided at both the pod & container - level, the container options override - the pod options. properties: localhostProfile: - description: localhostProfile indicates - a profile defined in a file on the - node should be used. The profile must - be preconfigured on the node to work. - Must be a descending path, relative - to the kubelet's configured seccomp - profile location. Must only be set - if type is "Localhost". type: string type: - description: "type indicates which kind - of seccomp profile will be applied. - Valid options are: \n Localhost - - a profile defined in a file on the - node should be used. RuntimeDefault - - the container runtime default profile - should be used. Unconfined - no profile - should be applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings - applied to all containers. If unspecified, - the options from the PodSecurityContext - will be used. If set in both SecurityContext - and PodSecurityContext, the value specified - in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where - the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName - field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName - is the name of the GMSA credential - spec to use. type: string hostProcess: - description: HostProcess determines - if a container should be run as a - 'Host Process' container. This field - is alpha-level and will only be honored - by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without - the feature flag will result in errors - when validating the Pod. All of a - Pod's containers must have the same - effective HostProcess value (it is - not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In - addition, if HostProcess is true then - HostNetwork must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows - to run the entrypoint of the container - process. Defaults to the user specified - in image metadata if unspecified. - May also be set in PodSecurityContext. - If set in both SecurityContext and - PodSecurityContext, the value specified - in SecurityContext takes precedence. type: string type: object type: object startupProbe: - description: 'StartupProbe indicates that the - Pod has successfully initialized. If specified, - no other probes are executed until this completes - successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe - failed. This can be used to provide different - probe parameters at the beginning of a Pod''s - lifecycle, when it might take a long time - to load data or warm a cache, than during - steady-state operation. This cannot be updated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -2433,162 +1024,61 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. - If this is not set, reads from stdin in the - container will always result in EOF. Default - is false. type: boolean stdinOnce: - description: Whether the container runtime should - close the stdin channel after it has been - opened by a single attach. When stdin is true - the stdin stream will remain open across multiple - attach sessions. If stdinOnce is set to true, - stdin is opened on container start, is empty - until the first client attaches to stdin, - and then remains open and accepts data until - the client disconnects, at which time stdin - is closed and remains closed until the container - is restarted. If this flag is false, a container - processes that reads from stdin will never - receive an EOF. Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file - to which the container''s termination message - will be written is mounted into the container''s - filesystem. Message written is intended to - be brief final status, such as an assertion - failure message. Will be truncated by the - node if greater than 4096 bytes. The total - message length across all containers will - be limited to 12kb. Defaults to /dev/termination-log. - Cannot be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message - should be populated. File will use the contents - of terminationMessagePath to populate the - container status message on both success and - failure. FallbackToLogsOnError will use the - last chunk of container log output if the - termination message file is empty and the - container exited with an error. The log output - is limited to 2048 bytes or 80 lines, whichever - is smaller. Defaults to File. Cannot be updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to - be true. Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block - devices to be used by the container. items: - description: volumeDevice describes a mapping - of a raw block device within a container. properties: devicePath: - description: devicePath is the path inside - of the container that the device will - be mapped to. type: string name: - description: name must match the name - of a persistentVolumeClaim in the pod type: string required: - devicePath @@ -2596,48 +1086,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting - of a Volume within a container. properties: mountPath: - description: Path within the container - at which the volume should be mounted. Must - not contain ':'. type: string mountPropagation: - description: mountPropagation determines - how mounts are propagated from the host - to container and the other way around. - When not set, MountPropagationNone is - used. This field is beta in 1.10. type: string name: - description: This must match the Name - of a Volume. type: string readOnly: - description: Mounted read-only if true, - read-write otherwise (false or unspecified). - Defaults to false. type: boolean subPath: - description: Path within the volume from - which the container's volume should - be mounted. Defaults to "" (volume's - root). type: string subPathExpr: - description: Expanded path within the - volume from which the container's volume - should be mounted. Behaves similarly - to SubPath but environment variable - references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and - SubPath are mutually exclusive. type: string required: - mountPath @@ -2645,376 +1106,158 @@ spec: type: object type: array workingDir: - description: Container's working directory. - If not specified, the container runtime's - default will be used, which might be configured - in the container image. Cannot be updated. type: string required: - name type: object type: array dnsConfig: - description: Specifies the DNS parameters of a pod. - Parameters specified here will be merged to the - generated DNS configuration based on DNSPolicy. properties: nameservers: - description: A list of DNS name server IP addresses. - This will be appended to the base nameservers - generated from DNSPolicy. Duplicated nameservers - will be removed. items: type: string type: array options: - description: A list of DNS resolver options. This - will be merged with the base options generated - from DNSPolicy. Duplicated entries will be removed. - Resolution options given in Options will override - those that appear in the base DNSPolicy. items: - description: PodDNSConfigOption defines DNS - resolver options of a pod. properties: name: - description: Required. type: string value: type: string type: object type: array searches: - description: A list of DNS search domains for - host-name lookup. This will be appended to the - base search paths generated from DNSPolicy. - Duplicated search paths will be removed. items: type: string type: array type: object dnsPolicy: - description: Set DNS policy for the pod. Defaults - to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', - 'ClusterFirst', 'Default' or 'None'. DNS parameters - given in DNSConfig will be merged with the policy - selected with DNSPolicy. To have DNS options set - along with hostNetwork, you have to specify DNS - policy explicitly to 'ClusterFirstWithHostNet'. type: string enableServiceLinks: - description: 'EnableServiceLinks indicates whether - information about services should be injected into - pod''s environment variables, matching the syntax - of Docker links. Optional: Defaults to true.' type: boolean ephemeralContainers: - description: List of ephemeral containers run in this - pod. Ephemeral containers may be run in an existing - pod to perform user-initiated actions such as debugging. - This list cannot be specified when creating a pod, - and it cannot be modified by updating the pod spec. - In order to add an ephemeral container to an existing - pod, use the pod's ephemeralcontainers subresource. - This field is alpha-level and is only honored by - servers that enable the EphemeralContainers feature. items: - description: An EphemeralContainer is a container - that may be added temporarily to an existing pod - for user-initiated activities such as debugging. - Ephemeral containers have no resource or scheduling - guarantees, and they will not be restarted when - they exit or when a pod is removed or restarted. - If an ephemeral container causes a pod to exceed - its resource allocation, the pod may be evicted. - Ephemeral containers may not be added by directly - updating the pod spec. They must be added via - the pod's ephemeralcontainers subresource, and - they will appear in the pod spec once added. This - is an alpha feature enabled by the EphemeralContainers - feature flag. properties: args: - description: 'Arguments to the entrypoint. The - docker image''s CMD is used if this is not - provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. - If a variable cannot be resolved, the reference - in the input string will be unchanged. Double - $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal - "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed - within a shell. The docker image''s ENTRYPOINT - is used if this is not provided. Variable - references $(VAR_NAME) are expanded using - the container''s environment. If a variable - cannot be resolved, the reference in the input - string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to - set in the container. Cannot be updated. items: - description: EnvVar represents an environment - variable present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined - environment variables in the container - and any service environment variables. - If a variable cannot be resolved, the - reference in the input string will be - unchanged. Double $$ are reduced to - a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Defaults to "".' type: string valueFrom: - description: Source for the environment - variable's value. Cannot be used if - value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - ConfigMap or its key must be - defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the - pod: supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema - the FieldPath is written in - terms of, defaults to "v1". type: string fieldPath: - description: Path of the field - to select in the specified API - version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of - the container: only resources limits - and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: - required for volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output - format of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource - to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret - in the pod's namespace properties: key: - description: The key of the secret - to select from. Must be a valid - secret key. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - Secret or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined - within a source must be a C_IDENTIFIER. All - invalid keys will be reported as an event - when the container is starting. When a key - exists in multiple sources, the value associated - with the last source will take precedence. - Values defined by an Env with a duplicate - key will take precedence. Cannot be updated. items: - description: EnvFromSource represents the - source of a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to - prepend to each key in the ConfigMap. - Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: - https://kubernetes.io/docs/concepts/containers/images' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, - Never, IfNotPresent. Defaults to Always if - :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Lifecycle is not allowed for ephemeral - containers. properties: postStart: - description: 'PostStart is called immediately - after a container is created. If the handler - fails, the container is terminated and - restarted according to its restart policy. - Other management of the container blocks - until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -3022,116 +1265,49 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately - before a container is terminated due to - an API request or management event such - as liveness/startup probe failure, preemption, - resource contention, etc. The handler - is not called if the container crashes - or exits. The reason for termination is - passed to the handler. The Pod''s termination - grace period countdown begins before the - PreStop hooked is executed. Regardless - of the outcome of the handler, the container - will eventually terminate within the Pod''s - termination grace period. Other management - of the container blocks until the hook - completes or until the termination grace - period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -3139,44 +1315,25 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -3184,63 +1341,37 @@ spec: type: object type: object livenessProbe: - description: Probes are not allowed for ephemeral - containers. properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -3248,202 +1379,103 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the ephemeral container - specified as a DNS_LABEL. This name must be - unique among all containers, init containers - and ephemeral containers. type: string ports: - description: Ports are not allowed for ephemeral - containers. items: - description: ContainerPort represents a network - port in a single container. properties: containerPort: - description: Number of port to expose - on the pod's IP address. This must be - a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the - external port to. type: string hostPort: - description: Number of port to expose - on the host. If specified, this must - be a valid port number, 0 < x < 65536. - If HostNetwork is specified, this must - match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be - an IANA_SVC_NAME and unique within the - pod. Each named port in a pod must have - a unique name. Name for the port that - can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be - UDP, TCP, or SCTP. Defaults to "TCP". type: string required: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: - description: Probes are not allowed for ephemeral - containers. properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -3451,100 +1483,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: Resources are not allowed for ephemeral - containers. Ephemeral containers use spare - resources already allocated to the pod. properties: limits: additionalProperties: @@ -3553,9 +1531,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum - amount of compute resources allowed. More - info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -3564,266 +1539,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum - amount of compute resources required. - If Requests is omitted for a container, - it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'Optional: SecurityContext defines - the security options the ephemeral container - should be run with. If set, the fields of - SecurityContext override the equivalent fields - of PodSecurityContext.' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges - than its parent process. This bool directly - controls if the no_new_privs flag will - be set on the container process. AllowPrivilegeEscalation - is true always when the container is: - 1) run as Privileged 2) has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop - when running containers. Defaults to the - default set of capabilities granted by - the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array type: object privileged: - description: Run container in privileged - mode. Processes in privileged containers - are essentially equivalent to root on - the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type - of proc mount to use for the containers. - The default is DefaultProcMount which - uses the container runtime defaults for - readonly paths and masked paths. This - requires the ProcMountType feature flag - to be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has - a read-only root filesystem. Default is - false. type: boolean runAsGroup: - description: The GID to run the entrypoint - of the container process. Uses runtime - default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container - must run as a non-root user. If true, - the Kubelet will validate the image at - runtime to ensure that it does not run - as UID 0 (root) and fail to start the - container if it does. If unset or false, - no such validation will be performed. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint - of the container process. Defaults to - user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied - to the container. If unspecified, the - container runtime will allocate a random - SELinux context for each container. May - also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. properties: level: - description: Level is SELinux level - label that applies to the container. type: string role: - description: Role is a SELinux role - label that applies to the container. type: string type: - description: Type is a SELinux type - label that applies to the container. type: string user: - description: User is a SELinux user - label that applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use - by this container. If seccomp options - are provided at both the pod & container - level, the container options override - the pod options. properties: localhostProfile: - description: localhostProfile indicates - a profile defined in a file on the - node should be used. The profile must - be preconfigured on the node to work. - Must be a descending path, relative - to the kubelet's configured seccomp - profile location. Must only be set - if type is "Localhost". type: string type: - description: "type indicates which kind - of seccomp profile will be applied. - Valid options are: \n Localhost - - a profile defined in a file on the - node should be used. RuntimeDefault - - the container runtime default profile - should be used. Unconfined - no profile - should be applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings - applied to all containers. If unspecified, - the options from the PodSecurityContext - will be used. If set in both SecurityContext - and PodSecurityContext, the value specified - in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where - the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName - field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName - is the name of the GMSA credential - spec to use. type: string hostProcess: - description: HostProcess determines - if a container should be run as a - 'Host Process' container. This field - is alpha-level and will only be honored - by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without - the feature flag will result in errors - when validating the Pod. All of a - Pod's containers must have the same - effective HostProcess value (it is - not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In - addition, if HostProcess is true then - HostNetwork must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows - to run the entrypoint of the container - process. Defaults to the user specified - in image metadata if unspecified. - May also be set in PodSecurityContext. - If set in both SecurityContext and - PodSecurityContext, the value specified - in SecurityContext takes precedence. type: string type: object type: object startupProbe: - description: Probes are not allowed for ephemeral - containers. properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -3831,172 +1641,63 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. - If this is not set, reads from stdin in the - container will always result in EOF. Default - is false. type: boolean stdinOnce: - description: Whether the container runtime should - close the stdin channel after it has been - opened by a single attach. When stdin is true - the stdin stream will remain open across multiple - attach sessions. If stdinOnce is set to true, - stdin is opened on container start, is empty - until the first client attaches to stdin, - and then remains open and accepts data until - the client disconnects, at which time stdin - is closed and remains closed until the container - is restarted. If this flag is false, a container - processes that reads from stdin will never - receive an EOF. Default is false type: boolean targetContainerName: - description: If set, the name of the container - from PodSpec that this ephemeral container - targets. The ephemeral container will be run - in the namespaces (IPC, PID, etc) of this - container. If not set then the ephemeral container - is run in whatever namespaces are shared for - the pod. Note that the container runtime must - support this feature. type: string terminationMessagePath: - description: 'Optional: Path at which the file - to which the container''s termination message - will be written is mounted into the container''s - filesystem. Message written is intended to - be brief final status, such as an assertion - failure message. Will be truncated by the - node if greater than 4096 bytes. The total - message length across all containers will - be limited to 12kb. Defaults to /dev/termination-log. - Cannot be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message - should be populated. File will use the contents - of terminationMessagePath to populate the - container status message on both success and - failure. FallbackToLogsOnError will use the - last chunk of container log output if the - termination message file is empty and the - container exited with an error. The log output - is limited to 2048 bytes or 80 lines, whichever - is smaller. Defaults to File. Cannot be updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to - be true. Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block - devices to be used by the container. items: - description: volumeDevice describes a mapping - of a raw block device within a container. properties: devicePath: - description: devicePath is the path inside - of the container that the device will - be mapped to. type: string name: - description: name must match the name - of a persistentVolumeClaim in the pod type: string required: - devicePath @@ -4004,48 +1705,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting - of a Volume within a container. properties: mountPath: - description: Path within the container - at which the volume should be mounted. Must - not contain ':'. type: string mountPropagation: - description: mountPropagation determines - how mounts are propagated from the host - to container and the other way around. - When not set, MountPropagationNone is - used. This field is beta in 1.10. type: string name: - description: This must match the Name - of a Volume. type: string readOnly: - description: Mounted read-only if true, - read-write otherwise (false or unspecified). - Defaults to false. type: boolean subPath: - description: Path within the volume from - which the container's volume should - be mounted. Defaults to "" (volume's - root). type: string subPathExpr: - description: Expanded path within the - volume from which the container's volume - should be mounted. Behaves similarly - to SubPath but environment variable - references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and - SubPath are mutually exclusive. type: string required: - mountPath @@ -4053,382 +1725,163 @@ spec: type: object type: array workingDir: - description: Container's working directory. - If not specified, the container runtime's - default will be used, which might be configured - in the container image. Cannot be updated. type: string required: - name type: object type: array hostAliases: - description: HostAliases is an optional list of hosts - and IPs that will be injected into the pod's hosts - file if specified. This is only valid for non-hostNetwork - pods. items: - description: HostAlias holds the mapping between - IP and hostnames that will be injected as an entry - in the pod's hosts file. properties: hostnames: - description: Hostnames for the above IP address. items: type: string type: array ip: - description: IP address of the host file entry. type: string type: object type: array hostIPC: - description: 'Use the host''s ipc namespace. Optional: - Default to false.' type: boolean hostNetwork: - description: Host networking requested for this pod. - Use the host's network namespace. If this option - is set, the ports that will be used must be specified. - Default to false. type: boolean hostPID: - description: 'Use the host''s pid namespace. Optional: - Default to false.' + type: boolean + hostUsers: type: boolean hostname: - description: Specifies the hostname of the Pod If - not specified, the pod's hostname will be set to - a system-defined value. type: string imagePullSecrets: - description: 'ImagePullSecrets is an optional list - of references to secrets in the same namespace to - use for pulling any of the images used by this PodSpec. - If specified, these secrets will be passed to individual - puller implementations for them to use. For example, - in the case of docker, only DockerConfig type secrets - are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' items: - description: LocalObjectReference contains enough - information to let you locate the referenced object - inside the same namespace. properties: name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic type: array initContainers: - description: 'List of initialization containers belonging - to the pod. Init containers are executed in order - prior to containers being started. If any init container - fails, the pod is considered to have failed and - is handled according to its restartPolicy. The name - for an init container or normal container must be - unique among all containers. Init containers may - not have Lifecycle actions, Readiness probes, Liveness - probes, or Startup probes. The resourceRequirements - of an init container are taken into account during - scheduling by finding the highest request/limit - for each resource type, and then using the max of - of that value or the sum of the normal containers. - Limits are applied to init containers in a similar - fashion. Init containers cannot currently be added - or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' items: - description: A single application container that - you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The - docker image''s CMD is used if this is not - provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. - If a variable cannot be resolved, the reference - in the input string will be unchanged. Double - $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal - "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: - description: 'Entrypoint array. Not executed - within a shell. The docker image''s ENTRYPOINT - is used if this is not provided. Variable - references $(VAR_NAME) are expanded using - the container''s environment. If a variable - cannot be resolved, the reference in the input - string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array env: - description: List of environment variables to - set in the container. Cannot be updated. items: - description: EnvVar represents an environment - variable present in a Container. properties: name: - description: Name of the environment variable. - Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) - are expanded using the previously defined - environment variables in the container - and any service environment variables. - If a variable cannot be resolved, the - reference in the input string will be - unchanged. Double $$ are reduced to - a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, - regardless of whether the variable exists - or not. Defaults to "".' type: string valueFrom: - description: Source for the environment - variable's value. Cannot be used if - value is not empty. properties: configMapKeyRef: - description: Selects a key of a ConfigMap. properties: key: - description: The key to select. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - ConfigMap or its key must be - defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the - pod: supports metadata.name, metadata.namespace, - `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema - the FieldPath is written in - terms of, defaults to "v1". type: string fieldPath: - description: Path of the field - to select in the specified API - version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of - the container: only resources limits - and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' properties: containerName: - description: 'Container name: - required for volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output - format of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource - to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: - description: Selects a key of a secret - in the pod's namespace properties: key: - description: The key of the secret - to select from. Must be a valid - secret key. type: string name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - Secret or its key must be defined type: boolean required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment - variables in the container. The keys defined - within a source must be a C_IDENTIFIER. All - invalid keys will be reported as an event - when the container is starting. When a key - exists in multiple sources, the value associated - with the last source will take precedence. - Values defined by an Env with a duplicate - key will take precedence. Cannot be updated. items: - description: EnvFromSource represents the - source of a set of ConfigMaps properties: configMapRef: - description: The ConfigMap to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: - description: An optional identifier to - prepend to each key in the ConfigMap. - Must be a C_IDENTIFIER. type: string secretRef: - description: The Secret to select from properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the Secret - must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Docker image name. More info: - https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level - config management to default or override container - images in workload controllers like Deployments - and StatefulSets.' type: string imagePullPolicy: - description: 'Image pull policy. One of Always, - Never, IfNotPresent. Defaults to Always if - :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' type: string lifecycle: - description: Actions that the management system - should take in response to container lifecycle - events. Cannot be updated. properties: postStart: - description: 'PostStart is called immediately - after a container is created. If the handler - fails, the container is terminated and - restarted according to its restart policy. - Other management of the container blocks - until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -4436,116 +1889,49 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object type: object preStop: - description: 'PreStop is called immediately - before a container is terminated due to - an API request or management event such - as liveness/startup probe failure, preemption, - resource contention, etc. The handler - is not called if the container crashes - or exits. The reason for termination is - passed to the handler. The Pod''s termination - grace period countdown begins before the - PreStop hooked is executed. Regardless - of the outcome of the handler, the container - will eventually terminate within the Pod''s - termination grace period. Other management - of the container blocks until the hook - completes or until the termination grace - period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: One and only one of the - following should be specified. Exec - specifies the action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the - command is root ('/') in the - container's filesystem. The command - is simply exec'd, it is not run - inside a shell, so traditional - shell instructions ('|', etc) - won't work. To use a shell, you - need to explicitly call out to - that shell. Exit status of 0 is - treated as live/healthy and non-zero - is unhealthy. items: type: string type: array type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect - to, defaults to the pod IP. You - probably want to set "Host" in - httpHeaders instead. type: string httpHeaders: - description: Custom headers to set - in the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in - HTTP probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -4553,44 +1939,25 @@ spec: type: object type: array path: - description: Path to access on the - HTTP server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: 'TCPSocket specifies an - action involving a TCP port. TCP hooks - not yet supported TODO: implement - a realistic TCP lifecycle hook' properties: host: - description: 'Optional: Host name - to connect to, defaults to the - pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the - port to access on the container. - Number must be in the range 1 - to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port @@ -4598,64 +1965,37 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. - Container will be restarted if the probe fails. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -4663,147 +2003,62 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object name: - description: Name of the container specified - as a DNS_LABEL. Each container in a pod must - have a unique name (DNS_LABEL). Cannot be - updated. type: string ports: - description: List of ports to expose from the - container. Exposing a port here gives the - system additional information about the network - connections a container uses, but is primarily - informational. Not specifying a port here - DOES NOT prevent that port from being exposed. - Any port which is listening on the default - "0.0.0.0" address inside a container will - be accessible from the network. Cannot be - updated. items: - description: ContainerPort represents a network - port in a single container. properties: containerPort: - description: Number of port to expose - on the pod's IP address. This must be - a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: - description: What host IP to bind the - external port to. type: string hostPort: - description: Number of port to expose - on the host. If specified, this must - be a valid port number, 0 < x < 65536. - If HostNetwork is specified, this must - match ContainerPort. Most containers - do not need this. format: int32 type: integer name: - description: If specified, this must be - an IANA_SVC_NAME and unique within the - pod. Each named port in a pod must have - a unique name. Name for the port that - can be referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be - UDP, TCP, or SCTP. Defaults to "TCP". type: string required: - containerPort @@ -4814,65 +2069,37 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service - readiness. Container will be removed from - service endpoints if the probe fails. Cannot - be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -4880,100 +2107,46 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object resources: - description: 'Compute Resources required by - this container. Cannot be updated. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' properties: limits: additionalProperties: @@ -4982,9 +2155,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum - amount of compute resources allowed. More - info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -4993,275 +2163,101 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum - amount of compute resources required. - If Requests is omitted for a container, - it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object securityContext: - description: 'SecurityContext defines the security - options the container should be run with. - If set, the fields of SecurityContext override - the equivalent fields of PodSecurityContext. - More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls - whether a process can gain more privileges - than its parent process. This bool directly - controls if the no_new_privs flag will - be set on the container process. AllowPrivilegeEscalation - is true always when the container is: - 1) run as Privileged 2) has CAP_SYS_ADMIN' type: boolean capabilities: - description: The capabilities to add/drop - when running containers. Defaults to the - default set of capabilities granted by - the container runtime. properties: add: - description: Added capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array drop: - description: Removed capabilities items: - description: Capability represent - POSIX capabilities type type: string type: array type: object privileged: - description: Run container in privileged - mode. Processes in privileged containers - are essentially equivalent to root on - the host. Defaults to false. type: boolean procMount: - description: procMount denotes the type - of proc mount to use for the containers. - The default is DefaultProcMount which - uses the container runtime defaults for - readonly paths and masked paths. This - requires the ProcMountType feature flag - to be enabled. type: string readOnlyRootFilesystem: - description: Whether this container has - a read-only root filesystem. Default is - false. type: boolean runAsGroup: - description: The GID to run the entrypoint - of the container process. Uses runtime - default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer runAsNonRoot: - description: Indicates that the container - must run as a non-root user. If true, - the Kubelet will validate the image at - runtime to ensure that it does not run - as UID 0 (root) and fail to start the - container if it does. If unset or false, - no such validation will be performed. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint - of the container process. Defaults to - user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied - to the container. If unspecified, the - container runtime will allocate a random - SELinux context for each container. May - also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext - takes precedence. properties: level: - description: Level is SELinux level - label that applies to the container. type: string role: - description: Role is a SELinux role - label that applies to the container. type: string type: - description: Type is a SELinux type - label that applies to the container. type: string user: - description: User is a SELinux user - label that applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use - by this container. If seccomp options - are provided at both the pod & container - level, the container options override - the pod options. properties: localhostProfile: - description: localhostProfile indicates - a profile defined in a file on the - node should be used. The profile must - be preconfigured on the node to work. - Must be a descending path, relative - to the kubelet's configured seccomp - profile location. Must only be set - if type is "Localhost". type: string type: - description: "type indicates which kind - of seccomp profile will be applied. - Valid options are: \n Localhost - - a profile defined in a file on the - node should be used. RuntimeDefault - - the container runtime default profile - should be used. Unconfined - no profile - should be applied." type: string required: - type type: object windowsOptions: - description: The Windows specific settings - applied to all containers. If unspecified, - the options from the PodSecurityContext - will be used. If set in both SecurityContext - and PodSecurityContext, the value specified - in SecurityContext takes precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where - the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName - field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName - is the name of the GMSA credential - spec to use. type: string hostProcess: - description: HostProcess determines - if a container should be run as a - 'Host Process' container. This field - is alpha-level and will only be honored - by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without - the feature flag will result in errors - when validating the Pod. All of a - Pod's containers must have the same - effective HostProcess value (it is - not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In - addition, if HostProcess is true then - HostNetwork must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows - to run the entrypoint of the container - process. Defaults to the user specified - in image metadata if unspecified. - May also be set in PodSecurityContext. - If set in both SecurityContext and - PodSecurityContext, the value specified - in SecurityContext takes precedence. type: string type: object type: object startupProbe: - description: 'StartupProbe indicates that the - Pod has successfully initialized. If specified, - no other probes are executed until this completes - successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe - failed. This can be used to provide different - probe parameters at the beginning of a Pod''s - lifecycle, when it might take a long time - to load data or warm a cache, than during - steady-state operation. This cannot be updated. - More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: One and only one of the following - should be specified. Exec specifies the - action to take. properties: command: - description: Command is the command - line to execute inside the container, - the working directory for the command is - root ('/') in the container's filesystem. - The command is simply exec'd, it is - not run inside a shell, so traditional - shell instructions ('|', etc) won't - work. To use a shell, you need to - explicitly call out to that shell. - Exit status of 0 is treated as live/healthy - and non-zero is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures - for the probe to be considered failed - after having succeeded. Defaults to 3. - Minimum value is 1. format: int32 type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object httpGet: - description: HTTPGet specifies the http - request to perform. properties: host: - description: Host name to connect to, - defaults to the pod IP. You probably - want to set "Host" in httpHeaders - instead. type: string httpHeaders: - description: Custom headers to set in - the request. HTTP allows repeated - headers. items: - description: HTTPHeader describes - a custom header to be used in HTTP - probes properties: name: - description: The header field - name type: string value: - description: The header field - value type: string required: - name @@ -5269,162 +2265,61 @@ spec: type: object type: array path: - description: Path to access on the HTTP - server. type: string port: anyOf: - type: integer - type: string - description: Name or number of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting - to the host. Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the - container has started before liveness - probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform - the probe. Default to 10 seconds. Minimum - value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes - for the probe to be considered successful - after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum - value is 1. format: int32 type: integer tcpSocket: - description: 'TCPSocket specifies an action - involving a TCP port. TCP hooks not yet - supported TODO: implement a realistic - TCP lifecycle hook' properties: host: - description: 'Optional: Host name to - connect to, defaults to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port - to access on the container. Number - must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds - the pod needs to terminate gracefully - upon probe failure. The grace period is - the duration in seconds after the processes - running in the pod are sent a termination - signal and the time when the processes - are forcibly halted with a kill signal. - Set this value longer than the expected - cleanup time for your process. If this - value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value - must be non-negative integer. The value - zero indicates stop immediately via the - kill signal (no opportunity to shut down). - This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which - the probe times out. Defaults to 1 second. - Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object stdin: - description: Whether this container should allocate - a buffer for stdin in the container runtime. - If this is not set, reads from stdin in the - container will always result in EOF. Default - is false. type: boolean stdinOnce: - description: Whether the container runtime should - close the stdin channel after it has been - opened by a single attach. When stdin is true - the stdin stream will remain open across multiple - attach sessions. If stdinOnce is set to true, - stdin is opened on container start, is empty - until the first client attaches to stdin, - and then remains open and accepts data until - the client disconnects, at which time stdin - is closed and remains closed until the container - is restarted. If this flag is false, a container - processes that reads from stdin will never - receive an EOF. Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file - to which the container''s termination message - will be written is mounted into the container''s - filesystem. Message written is intended to - be brief final status, such as an assertion - failure message. Will be truncated by the - node if greater than 4096 bytes. The total - message length across all containers will - be limited to 12kb. Defaults to /dev/termination-log. - Cannot be updated.' type: string terminationMessagePolicy: - description: Indicate how the termination message - should be populated. File will use the contents - of terminationMessagePath to populate the - container status message on both success and - failure. FallbackToLogsOnError will use the - last chunk of container log output if the - termination message file is empty and the - container exited with an error. The log output - is limited to 2048 bytes or 80 lines, whichever - is smaller. Defaults to File. Cannot be updated. type: string tty: - description: Whether this container should allocate - a TTY for itself, also requires 'stdin' to - be true. Default is false. type: boolean volumeDevices: - description: volumeDevices is the list of block - devices to be used by the container. items: - description: volumeDevice describes a mapping - of a raw block device within a container. properties: devicePath: - description: devicePath is the path inside - of the container that the device will - be mapped to. type: string name: - description: name must match the name - of a persistentVolumeClaim in the pod type: string required: - devicePath @@ -5432,48 +2327,19 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's - filesystem. Cannot be updated. items: - description: VolumeMount describes a mounting - of a Volume within a container. properties: mountPath: - description: Path within the container - at which the volume should be mounted. Must - not contain ':'. type: string mountPropagation: - description: mountPropagation determines - how mounts are propagated from the host - to container and the other way around. - When not set, MountPropagationNone is - used. This field is beta in 1.10. type: string name: - description: This must match the Name - of a Volume. type: string readOnly: - description: Mounted read-only if true, - read-write otherwise (false or unspecified). - Defaults to false. type: boolean subPath: - description: Path within the volume from - which the container's volume should - be mounted. Defaults to "" (volume's - root). type: string subPathExpr: - description: Expanded path within the - volume from which the container's volume - should be mounted. Behaves similarly - to SubPath but environment variable - references $(VAR_NAME) are expanded - using the container's environment. Defaults - to "" (volume's root). SubPathExpr and - SubPath are mutually exclusive. type: string required: - mountPath @@ -5481,30 +2347,25 @@ spec: type: object type: array workingDir: - description: Container's working directory. - If not specified, the container runtime's - default will be used, which might be configured - in the container image. Cannot be updated. type: string required: - name type: object type: array nodeName: - description: NodeName is a request to schedule this - pod onto a specific node. If it is non-empty, the - scheduler simply schedules this pod onto that node, - assuming that it fits resource requirements. type: string nodeSelector: additionalProperties: type: string - description: 'NodeSelector is a selector which must - be true for the pod to fit on a node. Selector which - must match a node''s labels for the pod to be scheduled - on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' type: object x-kubernetes-map-type: atomic + os: + properties: + name: + type: string + required: + - name + type: object overhead: additionalProperties: anyOf: @@ -5512,223 +2373,75 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Overhead represents the resource overhead - associated with running a pod for a given RuntimeClass. - This field will be autopopulated at admission time - by the RuntimeClass admission controller. If the - RuntimeClass admission controller is enabled, overhead - must not be set in Pod create requests. The RuntimeClass - admission controller will reject Pod create requests - which have the overhead already set. If RuntimeClass - is configured and selected in the PodSpec, Overhead - will be set to the value defined in the corresponding - RuntimeClass, otherwise it will remain unset and - treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md - This field is beta-level as of Kubernetes v1.18, - and is only honored by servers that enable the PodOverhead - feature.' type: object preemptionPolicy: - description: PreemptionPolicy is the Policy for preempting - pods with lower priority. One of Never, PreemptLowerPriority. - Defaults to PreemptLowerPriority if unset. This - field is beta-level, gated by the NonPreemptingPriority - feature-gate. type: string priority: - description: The priority value. Various system components - use this field to find the priority of the pod. - When Priority Admission Controller is enabled, it - prevents users from setting this field. The admission - controller populates this field from PriorityClassName. - The higher the value, the higher the priority. format: int32 type: integer priorityClassName: - description: If specified, indicates the pod's priority. - "system-node-critical" and "system-cluster-critical" - are two special keywords which indicate the highest - priorities with the former being the highest priority. - Any other name must be defined by creating a PriorityClass - object with that name. If not specified, the pod - priority will be default or zero if there is no - default. type: string readinessGates: - description: 'If specified, all readiness gates will - be evaluated for pod readiness. A pod is ready when - all its containers are ready AND all conditions - specified in the readiness gates have status equal - to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' items: - description: PodReadinessGate contains the reference - to a pod condition properties: conditionType: - description: ConditionType refers to a condition - in the pod's condition list with matching - type. type: string required: - conditionType type: object type: array restartPolicy: - description: 'Restart policy for all containers within - the pod. One of Always, OnFailure, Never. Default - to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' type: string runtimeClassName: - description: 'RuntimeClassName refers to a RuntimeClass - object in the node.k8s.io group, which should be - used to run this pod. If no RuntimeClass resource - matches the named class, the pod will not be run. - If unset or empty, the "legacy" RuntimeClass will - be used, which is an implicit class with an empty - definition that uses the default runtime handler. - More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class - This is a beta feature as of Kubernetes v1.14.' type: string schedulerName: - description: If specified, the pod will be dispatched - by specified scheduler. If not specified, the pod - will be dispatched by default scheduler. type: string securityContext: - description: 'SecurityContext holds pod-level security - attributes and common container settings. Optional: - Defaults to empty. See type description for default - values of each field.' properties: fsGroup: - description: "A special supplemental group that - applies to all containers in a pod. Some volume - types allow the Kubelet to change the ownership - of that volume to be owned by the pod: \n 1. - The owning GID will be the FSGroup 2. The setgid - bit is set (new files created in the volume - will be owned by FSGroup) 3. The permission - bits are OR'd with rw-rw---- \n If unset, the - Kubelet will not modify the ownership and permissions - of any volume." format: int64 type: integer fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior - of changing ownership and permission of the - volume before being exposed inside Pod. This - field will only apply to volume types which - support fsGroup based ownership(and permissions). - It will have no effect on ephemeral volume types - such as: secret, configmaps and emptydir. Valid - values are "OnRootMismatch" and "Always". If - not specified, "Always" is used.' type: string runAsGroup: - description: The GID to run the entrypoint of - the container process. Uses runtime default - if unset. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence for that container. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must - run as a non-root user. If true, the Kubelet - will validate the image at runtime to ensure - that it does not run as UID 0 (root) and fail - to start the container if it does. If unset - or false, no such validation will be performed. - May also be set in SecurityContext. If set - in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of - the container process. Defaults to user specified - in image metadata if unspecified. May also be - set in SecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified - in SecurityContext takes precedence for that - container. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied - to all containers. If unspecified, the container - runtime will allocate a random SELinux context - for each container. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence for that container. properties: level: - description: Level is SELinux level label - that applies to the container. type: string role: - description: Role is a SELinux role label - that applies to the container. type: string type: - description: Type is a SELinux type label - that applies to the container. type: string user: - description: User is a SELinux user label - that applies to the container. type: string type: object seccompProfile: - description: The seccomp options to use by the - containers in this pod. properties: localhostProfile: - description: localhostProfile indicates a - profile defined in a file on the node should - be used. The profile must be preconfigured - on the node to work. Must be a descending - path, relative to the kubelet's configured - seccomp profile location. Must only be set - if type is "Localhost". type: string type: - description: "type indicates which kind of - seccomp profile will be applied. Valid options - are: \n Localhost - a profile defined in - a file on the node should be used. RuntimeDefault - - the container runtime default profile - should be used. Unconfined - no profile - should be applied." type: string required: - type type: object supplementalGroups: - description: A list of groups applied to the first - process run in each container, in addition to - the container's primary GID. If unspecified, - no groups will be added to any container. items: format: int64 type: integer type: array sysctls: - description: Sysctls hold a list of namespaced - sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail - to launch. items: - description: Sysctl defines a kernel parameter - to be set properties: name: - description: Name of a property to set type: string value: - description: Value of a property to set type: string required: - name @@ -5736,193 +2449,59 @@ spec: type: object type: array windowsOptions: - description: The Windows specific settings applied - to all containers. If unspecified, the options - within a container's SecurityContext will be - used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes - precedence. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the - GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential - spec named by the GMSACredentialSpecName - field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the - name of the GMSA credential spec to use. type: string hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only - be honored by components that enable the - WindowsHostProcessContainers feature flag. - Setting this field without the feature flag - will result in errors when validating the - Pod. All of a Pod's containers must have - the same effective HostProcess value (it - is not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In - addition, if HostProcess is true then HostNetwork - must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run - the entrypoint of the container process. - Defaults to the user specified in image - metadata if unspecified. May also be set - in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified - in SecurityContext takes precedence. type: string type: object type: object serviceAccount: - description: 'DeprecatedServiceAccount is a depreciated - alias for ServiceAccountName. Deprecated: Use serviceAccountName - instead.' type: string serviceAccountName: - description: 'ServiceAccountName is the name of the - ServiceAccount to use to run this pod. More info: - https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' type: string setHostnameAsFQDN: - description: If true the pod's hostname will be configured - as the pod's FQDN, rather than the leaf name (the - default). In Linux containers, this means setting - the FQDN in the hostname field of the kernel (the - nodename field of struct utsname). In Windows containers, - this means setting the registry value of hostname - for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters - to FQDN. If a pod does not have FQDN, this has no - effect. Default to false. type: boolean shareProcessNamespace: - description: 'Share a single process namespace between - all of the containers in a pod. When this is set - containers will be able to view and signal processes - from other containers in the same pod, and the first - process in each container will not be assigned PID - 1. HostPID and ShareProcessNamespace cannot both - be set. Optional: Default to false.' type: boolean subdomain: - description: If specified, the fully qualified Pod - hostname will be "...svc.". If not specified, the pod will not have - a domainname at all. type: string terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully. May be decreased - in delete request. Value must be non-negative integer. - The value zero indicates stop immediately via the - kill signal (no opportunity to shut down). If this - value is nil, the default grace period will be used - instead. The grace period is the duration in seconds - after the processes running in the pod are sent - a termination signal and the time when the processes - are forcibly halted with a kill signal. Set this - value longer than the expected cleanup time for - your process. Defaults to 30 seconds. format: int64 type: integer tolerations: - description: If specified, the pod's tolerations. items: - description: The pod this Toleration is attached - to tolerates any taint that matches the triple - using the matching operator - . properties: effect: - description: Effect indicates the taint effect - to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, - PreferNoSchedule and NoExecute. type: string key: - description: Key is the taint key that the toleration - applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; - this combination means to match all values - and all keys. type: string operator: - description: Operator represents a key's relationship - to the value. Valid operators are Exists and - Equal. Defaults to Equal. Exists is equivalent - to wildcard for value, so that a pod can tolerate - all taints of a particular category. type: string tolerationSeconds: - description: TolerationSeconds represents the - period of time the toleration (which must - be of effect NoExecute, otherwise this field - is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint - forever (do not evict). Zero and negative - values will be treated as 0 (evict immediately) - by the system. format: int64 type: integer value: - description: Value is the taint value the toleration - matches to. If the operator is Exists, the - value should be empty, otherwise just a regular - string. type: string type: object type: array topologySpreadConstraints: - description: TopologySpreadConstraints describes how - a group of pods ought to spread across topology - domains. Scheduler will schedule pods in a way which - abides by the constraints. All topologySpreadConstraints - are ANDed. items: - description: TopologySpreadConstraint specifies - how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching - pods. Pods that match this label selector - are counted to determine the number of pods - in their corresponding topology domain. properties: matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. properties: key: - description: key is the label key - that the selector applies to. type: string operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. type: string values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. items: type: string type: array @@ -5934,66 +2513,27 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to - which pods may be unevenly distributed. When - `whenUnsatisfiable=DoNotSchedule`, it is the - maximum permitted difference between the number - of matching pods in the target topology and - the global minimum. For example, in a 3-zone - cluster, MaxSkew is set to 1, and pods with - the same labelSelector spread as 1/1/0: | - zone1 | zone2 | zone3 | | P | P | | - - if MaxSkew is 1, incoming pod can only be - scheduled to zone3 to become 1/1/1; scheduling - it onto zone1(zone2) would make the ActualSkew(2-0) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew - is 2, incoming pod can be scheduled onto any - zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies - that satisfy it. It''s a required field. Default - value is 1 and 0 is not allowed.' format: int32 type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string topologyKey: - description: TopologyKey is the key of node - labels. Nodes that have a label with this - key and identical values are considered to - be in the same topology. We consider each - as a "bucket", and try to put - balanced number of pods into each bucket. - It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how - to deal with a pod if it doesn''t satisfy - the spread constraint. - DoNotSchedule (default) - tells the scheduler not to schedule it. - - ScheduleAnyway tells the scheduler to schedule - the pod in any location, but giving higher - precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" - for an incoming pod if and only if every possible - node assigment for that pod would violate - "MaxSkew" on some topology. For example, in - a 3-zone cluster, MaxSkew is set to 1, and - pods with the same labelSelector spread as - 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | - If WhenUnsatisfiable is set to DoNotSchedule, - incoming pod can only be scheduled to zone2(zone3) - to become 3/2/1(3/1/2) as ActualSkew(2-1) - on zone2(zone3) satisfies MaxSkew(1). In other - words, the cluster can still be imbalanced, - but scheduler won''t make it *more* imbalanced. - It''s a required field.' type: string required: - maxSkew @@ -6006,258 +2546,106 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map volumes: - description: 'List of volumes that can be mounted - by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' items: - description: Volume represents a named volume in - a pod that may be accessed by any container in - the pod. properties: awsElasticBlockStore: - description: 'AWSElasticBlockStore represents - an AWS Disk resource that is attached to a - kubelet''s host machine and then exposed to - the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'Filesystem type of the volume - that you want to mount. Tip: Ensure that - the filesystem type is supported by the - host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the - filesystem from compromising the machine' type: string partition: - description: 'The partition in the volume - that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the - partition as "1". Similarly, the volume - partition for /dev/sda is "0" (or you - can leave the property empty).' format: int32 type: integer readOnly: - description: 'Specify "true" to force and - set the ReadOnly property in VolumeMounts - to "true". If omitted, the default is - "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'Unique ID of the persistent - disk resource in AWS (Amazon EBS volume). - More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: AzureDisk represents an Azure Data - Disk mount on the host and bind mount to the - pod. properties: cachingMode: - description: 'Host Caching mode: None, Read - Only, Read Write.' type: string diskName: - description: The Name of the data disk in - the blob storage type: string diskURI: - description: The URI the data disk in the - blob storage type: string fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" - if unspecified. type: string kind: - description: 'Expected values Shared: multiple - blob disks per storage account Dedicated: - single blob disk per storage account Managed: - azure managed data disk (only in managed - availability set). defaults to shared' type: string readOnly: - description: Defaults to false (read/write). - ReadOnly here will force the ReadOnly - setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: AzureFile represents an Azure File - Service mount on the host and bind mount to - the pod. properties: readOnly: - description: Defaults to false (read/write). - ReadOnly here will force the ReadOnly - setting in VolumeMounts. type: boolean secretName: - description: the name of secret that contains - Azure Storage Account Name and Key type: string shareName: - description: Share Name type: string required: - secretName - shareName type: object cephfs: - description: CephFS represents a Ceph FS mount - on the host that shares a pod's lifetime properties: monitors: - description: 'Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'Optional: Used as the mounted - root, rather than the full Ceph tree, - default is /' type: string readOnly: - description: 'Optional: Defaults to false - (read/write). ReadOnly here will force - the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'Optional: SecretFile is the - path to key ring for User, default is - /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'Optional: SecretRef is reference - to the authentication secret for User, - default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic user: - description: 'Optional: User is the rados - user name, default is admin More info: - https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'Cinder represents a cinder volume - attached and mounted on kubelets host machine. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'Filesystem type to mount. - Must be a filesystem type supported by - the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'Optional: Defaults to false - (read/write). ReadOnly here will force - the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'Optional: points to a secret - object containing parameters used to connect - to OpenStack.' properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volume id used to identify - the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: ConfigMap represents a configMap - that should populate this volume properties: defaultMode: - description: 'Optional: mode bits used to - set permissions on created files by default. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. Defaults to 0644. Directories - within the path are not affected by this - setting. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value - pair in the Data field of the referenced - ConfigMap will be projected into the volume - as a file whose name is the key and content - is the value. If specified, the listed - keys will be projected into the specified - paths, and unlisted keys will not be present. - If a key is specified which is not present - in the ConfigMap, the volume setup will - error unless it is marked optional. Paths - must be relative and may not contain the - '..' path or start with '..'. items: - description: Maps a string key to a path - within a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits - used to set permissions on this - file. Must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, JSON - requires decimal values for mode - bits. If not specified, the volume - defaultMode will be used. This might - be in conflict with other options - that affect the file mode, like - fsGroup, and the result can be other - mode bits set.' format: int32 type: integer path: - description: The relative path of - the file to map the key to. May - not be an absolute path. May not - contain the path element '..'. May - not start with the string '..'. type: string required: - key @@ -6265,264 +2653,92 @@ spec: type: object type: array name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string optional: - description: Specify whether the ConfigMap - or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: - description: CSI (Container Storage Interface) - represents ephemeral storage that is handled - by certain external CSI drivers (Beta feature). properties: driver: - description: Driver is the name of the CSI - driver that handles this volume. Consult - with your admin for the correct name as - registered in the cluster. type: string fsType: - description: Filesystem type to mount. Ex. - "ext4", "xfs", "ntfs". If not provided, - the empty value is passed to the associated - CSI driver which will determine the default - filesystem to apply. type: string nodePublishSecretRef: - description: NodePublishSecretRef is a reference - to the secret object containing sensitive - information to pass to the CSI driver - to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field - is optional, and may be empty if no secret - is required. If the secret object contains - more than one secret, all secret references - are passed. properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: Specifies a read-only configuration - for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: VolumeAttributes stores driver-specific - properties that are passed to the CSI - driver. Consult your driver's documentation - for supported values. type: object required: - driver type: object downwardAPI: - description: DownwardAPI represents downward - API about the pod that should populate this - volume properties: defaultMode: - description: 'Optional: mode bits to use - on created files by default. Must be a - Optional: mode bits used to set permissions - on created files by default. Must be an - octal value between 0000 and 0777 or a - decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. Defaults to 0644. Directories within - the path are not affected by this setting. - This might be in conflict with other options - that affect the file mode, like fsGroup, - and the result can be other mode bits - set.' format: int32 type: integer items: - description: Items is a list of downward - API volume file items: - description: DownwardAPIVolumeFile represents - information to create the file containing - the pod field properties: fieldRef: - description: 'Required: Selects a - field of the pod: only annotations, - labels, name and namespace are supported.' properties: apiVersion: - description: Version of the schema - the FieldPath is written in - terms of, defaults to "v1". type: string fieldPath: - description: Path of the field - to select in the specified API - version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits - used to set permissions on this - file, must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, JSON - requires decimal values for mode - bits. If not specified, the volume - defaultMode will be used. This might - be in conflict with other options - that affect the file mode, like - fsGroup, and the result can be other - mode bits set.' format: int32 type: integer path: - description: 'Required: Path is the - relative path name of the file to - be created. Must not be absolute - or contain the ''..'' path. Must - be utf-8 encoded. The first item - of the relative path must not start - with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of - the container: only resources limits - and requests (limits.cpu, limits.memory, - requests.cpu and requests.memory) - are currently supported.' properties: containerName: - description: 'Container name: - required for volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output - format of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource - to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'EmptyDir represents a temporary - directory that shares a pod''s lifetime. More - info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'What type of storage medium - should back this directory. The default - is "" which means to use the node''s default - medium. Must be an empty string (default) - or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'Total amount of local storage - required for this EmptyDir volume. The - size limit is also applicable for memory - medium. The maximum usage on memory medium - EmptyDir would be the minimum value between - the SizeLimit specified here and the sum - of memory limits of all containers in - a pod. The default is nil which means - that the limit is undefined. More info: - http://kubernetes.io/docs/user-guide/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "Ephemeral represents a volume - that is handled by a cluster storage driver. - The volume's lifecycle is tied to the pod - that defines it - it will be created before - the pod starts, and deleted when the pod is - removed. \n Use this if: a) the volume is - only needed while the pod runs, b) features - of normal volumes like restoring from snapshot - or capacity tracking are needed, c) the - storage driver is specified through a storage - class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information - on the connection between this volume type - \ and PersistentVolumeClaim). \n Use PersistentVolumeClaim - or one of the vendor-specific APIs for volumes - that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight - local ephemeral volumes if the CSI driver - is meant to be used that way - see the documentation - of the driver for more information. \n A pod - can use both types of ephemeral volumes and - persistent volumes at the same time. \n This - is a beta feature and only available when - the GenericEphemeralVolume feature gate is - enabled." properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone - PVC to provision the volume. The pod in - which this EphemeralVolumeSource is embedded - will be the owner of the PVC, i.e. the - PVC will be deleted together with the - pod. The name of the PVC will be `-` where `` - is the name from the `PodSpec.Volumes` - array entry. Pod validation will reject - the pod if the concatenated name is not - valid for a PVC (for example, too long). - \n An existing PVC with that name that - is not owned by the pod will *not* be - used for the pod to avoid using an unrelated - volume by mistake. Starting the pod is - then blocked until the unrelated PVC is - removed. If such a pre-created PVC is - meant to be used by the pod, the PVC has - to updated with an owner reference to - the pod once the pod exists. Normally - this should not be necessary, but it may - be useful when manually reconstructing - a broken cluster. \n This field is read-only - and no changes will be made by Kubernetes - to the PVC after it has been created. - \n Required, must not be nil." properties: metadata: - description: May contain labels and - annotations that will be copied into - the PVC when creating it. No other - fields are allowed and will be rejected - during validation. properties: annotations: additionalProperties: @@ -6542,117 +2758,38 @@ spec: type: string type: object spec: - description: The specification for the - PersistentVolumeClaim. The entire - content is copied unchanged into the - PVC that gets created from this template. - The same fields as in a PersistentVolumeClaim - are also valid here. properties: accessModes: - description: 'AccessModes contains - the desired access modes the volume - should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be - used to specify either: * An existing - VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external - controller can support the specified - data source, it will create a - new volume based on the contents - of the specified data source. - If the AnyVolumeDataSource feature - gate is enabled, this field will - always have the same contents - as the DataSourceRef field.' properties: apiGroup: - description: APIGroup is the - group for the resource being - referenced. If APIGroup is - not specified, the specified - Kind must be in the core API - group. For any other third-party - types, APIGroup is required. type: string kind: - description: Kind is the type - of resource being referenced type: string name: - description: Name is the name - of resource being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'Specifies the object - from which to populate the volume - with data, if a non-empty volume - is desired. This may be any local - object from a non-empty API group - (non core object) or a PersistentVolumeClaim - object. When this field is specified, - volume binding will only succeed - if the type of the specified object - matches some installed volume - populator or dynamic provisioner. - This field will replace the functionality - of the DataSource field and as - such if both fields are non-empty, - they must have the same value. - For backwards compatibility, both - fields (DataSource and DataSourceRef) - will be set to the same value - automatically if one of them is - empty and the other is non-empty. - There are two important differences - between DataSource and DataSourceRef: - * While DataSource only allows - two specific types of objects, - DataSourceRef allows any non-core - object, as well as PersistentVolumeClaim - objects. * While DataSource ignores - disallowed values (dropping them), - DataSourceRef preserves all - values, and generates an error - if a disallowed value is specified. - (Alpha) Using this field requires - the AnyVolumeDataSource feature - gate to be enabled.' properties: apiGroup: - description: APIGroup is the - group for the resource being - referenced. If APIGroup is - not specified, the specified - Kind must be in the core API - group. For any other third-party - types, APIGroup is required. type: string kind: - description: Kind is the type - of resource being referenced type: string name: - description: Name is the name - of resource being referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic resources: - description: 'Resources represents - the minimum resources the volume - should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -6661,10 +2798,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes - the maximum amount of compute - resources allowed. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -6673,57 +2806,18 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes - the minimum amount of compute - resources required. If Requests - is omitted for a container, - it defaults to Limits if that - is explicitly specified, otherwise - to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: A label query over - volumes to consider for binding. properties: matchExpressions: - description: matchExpressions - is a list of label selector - requirements. The requirements - are ANDed. items: - description: A label selector - requirement is a selector - that contains values, a - key, and an operator that - relates the key and values. properties: key: - description: key is the - label key that the selector - applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is - an array of string values. - If the operator is In - or NotIn, the values - array must be non-empty. - If the operator is Exists - or DoesNotExist, the - values array must be - empty. This array is - replaced during a strategic - merge patch. items: type: string type: array @@ -6735,34 +2829,14 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is - a map of {key,value} pairs. - A single {key,value} in the - matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", - the operator is "In", and - the values array contains - only "value". The requirements - are ANDed. type: object type: object + x-kubernetes-map-type: atomic storageClassName: - description: 'Name of the StorageClass - required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines - what type of volume is required - by the claim. Value of Filesystem - is implied when not included in - claim spec. type: string volumeName: - description: VolumeName is the binding - reference to the PersistentVolume - backing this claim. type: string type: object required: @@ -6770,293 +2844,127 @@ spec: type: object type: object fc: - description: FC represents a Fibre Channel resource - that is attached to a kubelet's host machine - and then exposed to the pod. properties: fsType: - description: 'Filesystem type to mount. - Must be a filesystem type supported by - the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. TODO: how do - we prevent errors in the filesystem from - compromising the machine' type: string lun: - description: 'Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'Optional: Defaults to false - (read/write). ReadOnly here will force - the ReadOnly setting in VolumeMounts.' type: boolean targetWWNs: - description: 'Optional: FC target worldwide - names (WWNs)' items: type: string type: array wwids: - description: 'Optional: FC volume world - wide identifiers (wwids) Either wwids - or combination of targetWWNs and lun must - be set, but not both simultaneously.' items: type: string type: array type: object flexVolume: - description: FlexVolume represents a generic - volume resource that is provisioned/attached - using an exec based plugin. properties: driver: - description: Driver is the name of the driver - to use for this volume. type: string fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". The default filesystem depends - on FlexVolume script. type: string options: additionalProperties: type: string - description: 'Optional: Extra command options - if any.' type: object readOnly: - description: 'Optional: Defaults to false - (read/write). ReadOnly here will force - the ReadOnly setting in VolumeMounts.' type: boolean secretRef: - description: 'Optional: SecretRef is reference - to the secret object containing sensitive - information to pass to the plugin scripts. - This may be empty if no secret object - is specified. If the secret object contains - more than one secret, all secrets are - passed to the plugin scripts.' properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object flocker: - description: Flocker represents a Flocker volume - attached to a kubelet's host machine. This - depends on the Flocker control service being - running properties: datasetName: - description: Name of the dataset stored - as metadata -> name on the dataset for - Flocker should be considered as deprecated type: string datasetUUID: - description: UUID of the dataset. This is - unique identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'GCEPersistentDisk represents a - GCE Disk resource that is attached to a kubelet''s - host machine and then exposed to the pod. - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'Filesystem type of the volume - that you want to mount. Tip: Ensure that - the filesystem type is supported by the - host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the - filesystem from compromising the machine' type: string partition: - description: 'The partition in the volume - that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the - partition as "1". Similarly, the volume - partition for /dev/sda is "0" (or you - can leave the property empty). More info: - https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'Unique name of the PD resource - in GCE. Used to identify the disk in GCE. - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'ReadOnly here will force the - ReadOnly setting in VolumeMounts. Defaults - to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean required: - pdName type: object gitRepo: - description: 'GitRepo represents a git repository - at a particular revision. DEPRECATED: GitRepo - is deprecated. To provision a container with - a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount - the EmptyDir into the Pod''s container.' properties: directory: - description: Target directory name. Must - not contain or start with '..'. If '.' - is supplied, the volume directory will - be the git repository. Otherwise, if - specified, the volume will contain the - git repository in the subdirectory with - the given name. type: string repository: - description: Repository URL type: string revision: - description: Commit hash for the specified - revision. type: string required: - repository type: object glusterfs: - description: 'Glusterfs represents a Glusterfs - mount on the host that shares a pod''s lifetime. - More info: https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'EndpointsName is the endpoint - name that details Glusterfs topology. - More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'Path is the Glusterfs volume - path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'ReadOnly here will force the - Glusterfs volume to be mounted with read-only - permissions. Defaults to false. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean required: - endpoints - path type: object hostPath: - description: 'HostPath represents a pre-existing - file or directory on the host machine that - is directly exposed to the container. This - is generally used for system agents or other - privileged things that are allowed to see - the host machine. Most containers will NOT - need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who - can use host directory mounts and who can/can - not mount host directories as read/write.' properties: path: - description: 'Path of the directory on the - host. If the path is a symlink, it will - follow the link to the real path. More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'Type for HostPath Volume Defaults - to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'ISCSI represents an ISCSI Disk - resource that is attached to a kubelet''s - host machine and then exposed to the pod. - More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: whether support iSCSI Discovery - CHAP authentication type: boolean chapAuthSession: - description: whether support iSCSI Session - CHAP authentication type: boolean fsType: - description: 'Filesystem type of the volume - that you want to mount. Tip: Ensure that - the filesystem type is supported by the - host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the - filesystem from compromising the machine' type: string initiatorName: - description: Custom iSCSI Initiator Name. - If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created - for the connection. type: string iqn: - description: Target iSCSI Qualified Name. type: string iscsiInterface: - description: iSCSI Interface Name that uses - an iSCSI transport. Defaults to 'default' - (tcp). type: string lun: - description: iSCSI Target Lun number. format: int32 type: integer portals: - description: iSCSI Target Portal List. The - portal is either an IP or ip_addr:port - if the port is other than default (typically - TCP ports 860 and 3260). items: type: string type: array readOnly: - description: ReadOnly here will force the - ReadOnly setting in VolumeMounts. Defaults - to false. type: boolean secretRef: - description: CHAP Secret for iSCSI target - and initiator authentication properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the - port is other than default (typically - TCP ports 860 and 3260). type: string required: - iqn @@ -7064,177 +2972,67 @@ spec: - targetPortal type: object name: - description: 'Volume''s name. Must be a DNS_LABEL - and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'NFS represents an NFS mount on - the host that shares a pod''s lifetime More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'Path that is exported by the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'ReadOnly here will force the - NFS export to be mounted with read-only - permissions. Defaults to false. More info: - https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'Server is the hostname or - IP address of the NFS server. More info: - https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: - path - server type: object persistentVolumeClaim: - description: 'PersistentVolumeClaimVolumeSource - represents a reference to a PersistentVolumeClaim - in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'ClaimName is the name of a - PersistentVolumeClaim in the same namespace - as the pod using this volume. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: Will force the ReadOnly setting - in VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: PhotonPersistentDisk represents - a PhotonController persistent disk attached - and mounted on kubelets host machine properties: fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" - if unspecified. type: string pdID: - description: ID that identifies Photon Controller - persistent disk type: string required: - pdID type: object portworxVolume: - description: PortworxVolume represents a portworx - volume attached and mounted on kubelets host - machine properties: fsType: - description: FSType represents the filesystem - type to mount Must be a filesystem type - supported by the host operating system. - Ex. "ext4", "xfs". Implicitly inferred - to be "ext4" if unspecified. type: string readOnly: - description: Defaults to false (read/write). - ReadOnly here will force the ReadOnly - setting in VolumeMounts. type: boolean volumeID: - description: VolumeID uniquely identifies - a Portworx volume type: string required: - volumeID type: object projected: - description: Items for all in one resources - secrets, configmaps, and downward API properties: defaultMode: - description: Mode bits used to set permissions - on created files by default. Must be an - octal value between 0000 and 0777 or a - decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. Directories within the path are - not affected by this setting. This might - be in conflict with other options that - affect the file mode, like fsGroup, and - the result can be other mode bits set. format: int32 type: integer sources: - description: list of volume projections items: - description: Projection that may be projected - along with other supported volume types properties: configMap: - description: information about the - configMap data to project properties: items: - description: If unspecified, each - key-value pair in the Data field - of the referenced ConfigMap - will be projected into the volume - as a file whose name is the - key and content is the value. - If specified, the listed keys - will be projected into the specified - paths, and unlisted keys will - not be present. If a key is - specified which is not present - in the ConfigMap, the volume - setup will error unless it is - marked optional. Paths must - be relative and may not contain - the '..' path or start with - '..'. items: - description: Maps a string key - to a path within a volume. properties: key: - description: The key to - project. type: string mode: - description: 'Optional: - mode bits used to set - permissions on this file. - Must be an octal value - between 0000 and 0777 - or a decimal value between - 0 and 511. YAML accepts - both octal and decimal - values, JSON requires - decimal values for mode - bits. If not specified, - the volume defaultMode - will be used. This might - be in conflict with other - options that affect the - file mode, like fsGroup, - and the result can be - other mode bits set.' format: int32 type: integer path: - description: The relative - path of the file to map - the key to. May not be - an absolute path. May - not contain the path element - '..'. May not start with - the string '..'. type: string required: - key @@ -7242,181 +3040,63 @@ spec: type: object type: array name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - ConfigMap or its keys must be - defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: - description: information about the - downwardAPI data to project properties: items: - description: Items is a list of - DownwardAPIVolume file items: - description: DownwardAPIVolumeFile - represents information to - create the file containing - the pod field properties: fieldRef: - description: 'Required: - Selects a field of the - pod: only annotations, - labels, name and namespace - are supported.' properties: apiVersion: - description: Version - of the schema the - FieldPath is written - in terms of, defaults - to "v1". type: string fieldPath: - description: Path of - the field to select - in the specified API - version. type: string required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: - mode bits used to set - permissions on this file, - must be an octal value - between 0000 and 0777 - or a decimal value between - 0 and 511. YAML accepts - both octal and decimal - values, JSON requires - decimal values for mode - bits. If not specified, - the volume defaultMode - will be used. This might - be in conflict with other - options that affect the - file mode, like fsGroup, - and the result can be - other mode bits set.' format: int32 type: integer path: - description: 'Required: - Path is the relative - path name of the file - to be created. Must not - be absolute or contain - the ''..'' path. Must - be utf-8 encoded. The - first item of the relative - path must not start with - ''..''' type: string resourceFieldRef: - description: 'Selects a - resource of the container: - only resources limits - and requests (limits.cpu, - limits.memory, requests.cpu - and requests.memory) are - currently supported.' properties: containerName: - description: 'Container - name: required for - volumes, optional - for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies - the output format - of the exposed resources, - defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: - resource to select' type: string required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object secret: - description: information about the - secret data to project properties: items: - description: If unspecified, each - key-value pair in the Data field - of the referenced Secret will - be projected into the volume - as a file whose name is the - key and content is the value. - If specified, the listed keys - will be projected into the specified - paths, and unlisted keys will - not be present. If a key is - specified which is not present - in the Secret, the volume setup - will error unless it is marked - optional. Paths must be relative - and may not contain the '..' - path or start with '..'. items: - description: Maps a string key - to a path within a volume. properties: key: - description: The key to - project. type: string mode: - description: 'Optional: - mode bits used to set - permissions on this file. - Must be an octal value - between 0000 and 0777 - or a decimal value between - 0 and 511. YAML accepts - both octal and decimal - values, JSON requires - decimal values for mode - bits. If not specified, - the volume defaultMode - will be used. This might - be in conflict with other - options that affect the - file mode, like fsGroup, - and the result can be - other mode bits set.' format: int32 type: integer path: - description: The relative - path of the file to map - the key to. May not be - an absolute path. May - not contain the path element - '..'. May not start with - the string '..'. type: string required: - key @@ -7424,52 +3104,19 @@ spec: type: object type: array name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. - apiVersion, kind, uid?' type: string optional: - description: Specify whether the - Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: - description: information about the - serviceAccountToken data to project properties: audience: - description: Audience is the intended - audience of the token. A recipient - of a token must identify itself - with an identifier specified - in the audience of the token, - and otherwise should reject - the token. The audience defaults - to the identifier of the apiserver. type: string expirationSeconds: - description: ExpirationSeconds - is the requested duration of - validity of the service account - token. As the token approaches - expiration, the kubelet volume - plugin will proactively rotate - the service account token. The - kubelet will start trying to - rotate the token if the token - is older than 80 percent of - its time to live or if the token - is older than 24 hours.Defaults - to 1 hour and must be at least - 10 minutes. format: int64 type: integer path: - description: Path is the path - relative to the mount point - of the file to project the token - into. type: string required: - path @@ -7478,161 +3125,76 @@ spec: type: array type: object quobyte: - description: Quobyte represents a Quobyte mount - on the host that shares a pod's lifetime properties: group: - description: Group to map volume access - to Default is no group type: string readOnly: - description: ReadOnly here will force the - Quobyte volume to be mounted with read-only - permissions. Defaults to false. type: boolean registry: - description: Registry represents a single - or multiple Quobyte Registry services - specified as a string as host:port pair - (multiple entries are separated with commas) - which acts as the central registry for - volumes type: string tenant: - description: Tenant owning the given Quobyte - volume in the Backend Used with dynamically - provisioned Quobyte volumes, value is - set by the plugin type: string user: - description: User to map volume access to - Defaults to serivceaccount user type: string volume: - description: Volume is a string that references - an already created Quobyte volume by name. type: string required: - registry - volume type: object rbd: - description: 'RBD represents a Rados Block Device - mount on the host that shares a pod''s lifetime. - More info: https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'Filesystem type of the volume - that you want to mount. Tip: Ensure that - the filesystem type is supported by the - host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the - filesystem from compromising the machine' type: string image: - description: 'The rados image name. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'Keyring is the path to key - ring for RBDUser. Default is /etc/ceph/keyring. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'A collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'The rados pool name. Default - is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'ReadOnly here will force the - ReadOnly setting in VolumeMounts. Defaults - to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'SecretRef is name of the authentication - secret for RBDUser. If provided overrides - keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic user: - description: 'The rados user name. Default - is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: ScaleIO represents a ScaleIO persistent - volume attached and mounted on Kubernetes - nodes. properties: fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". Default is "xfs". type: string gateway: - description: The host address of the ScaleIO - API Gateway. type: string protectionDomain: - description: The name of the ScaleIO Protection - Domain for the configured storage. type: string readOnly: - description: Defaults to false (read/write). - ReadOnly here will force the ReadOnly - setting in VolumeMounts. type: boolean secretRef: - description: SecretRef references to the - secret for ScaleIO user and other sensitive - information. If this is not provided, - Login operation will fail. properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic sslEnabled: - description: Flag to enable/disable SSL - communication with Gateway, default false type: boolean storageMode: - description: Indicates whether the storage - for a volume should be ThickProvisioned - or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: - description: The ScaleIO Storage Pool associated - with the protection domain. type: string system: - description: The name of the storage system - as configured in ScaleIO. type: string volumeName: - description: The name of a volume already - created in the ScaleIO system that is - associated with this volume source. type: string required: - gateway @@ -7640,66 +3202,19 @@ spec: - system type: object secret: - description: 'Secret represents a secret that - should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'Optional: mode bits used to - set permissions on created files by default. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. Defaults to 0644. Directories - within the path are not affected by this - setting. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value - pair in the Data field of the referenced - Secret will be projected into the volume - as a file whose name is the key and content - is the value. If specified, the listed - keys will be projected into the specified - paths, and unlisted keys will not be present. - If a key is specified which is not present - in the Secret, the volume setup will error - unless it is marked optional. Paths must - be relative and may not contain the '..' - path or start with '..'. items: - description: Maps a string key to a path - within a volume. properties: key: - description: The key to project. type: string mode: - description: 'Optional: mode bits - used to set permissions on this - file. Must be an octal value between - 0000 and 0777 or a decimal value - between 0 and 511. YAML accepts - both octal and decimal values, JSON - requires decimal values for mode - bits. If not specified, the volume - defaultMode will be used. This might - be in conflict with other options - that affect the file mode, like - fsGroup, and the result can be other - mode bits set.' format: int32 type: integer path: - description: The relative path of - the file to map the key to. May - not be an absolute path. May not - contain the path element '..'. May - not start with the string '..'. type: string required: - key @@ -7707,87 +3222,36 @@ spec: type: object type: array optional: - description: Specify whether the Secret - or its keys must be defined type: boolean secretName: - description: 'Name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: StorageOS represents a StorageOS - volume attached and mounted on Kubernetes - nodes. properties: fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" - if unspecified. type: string readOnly: - description: Defaults to false (read/write). - ReadOnly here will force the ReadOnly - setting in VolumeMounts. type: boolean secretRef: - description: SecretRef specifies the secret - to use for obtaining the StorageOS API - credentials. If not specified, default - values will be attempted. properties: name: - description: 'Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: VolumeName is the human-readable - name of the StorageOS volume. Volume - names are only unique within a namespace. type: string volumeNamespace: - description: VolumeNamespace specifies the - scope of the volume within StorageOS. If - no namespace is specified then the Pod's - namespace will be used. This allows the - Kubernetes name scoping to be mirrored - within StorageOS for tighter integration. - Set VolumeName to any name to override - the default behaviour. Set to "default" - if you are not using namespaces within - StorageOS. Namespaces that do not pre-exist - within StorageOS will be created. type: string type: object vsphereVolume: - description: VsphereVolume represents a vSphere - volume attached and mounted on kubelets host - machine properties: fsType: - description: Filesystem type to mount. Must - be a filesystem type supported by the - host operating system. Ex. "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" - if unspecified. type: string storagePolicyID: - description: Storage Policy Based Management - (SPBM) profile ID associated with the - StoragePolicyName. type: string storagePolicyName: - description: Storage Policy Based Management - (SPBM) profile name. type: string volumePath: - description: Path that identifies vSphere - volume vmdk type: string required: - volumePath @@ -7801,56 +3265,29 @@ spec: type: object type: object updateStrategy: - description: updateStrategy indicates the StatefulSetUpdateStrategy - that will be employed to update Pods in the StatefulSet - when a revision is made to Template. properties: rollingUpdate: - description: RollingUpdate is used to communicate parameters - when Type is RollingUpdateStatefulSetStrategyType. properties: + maxUnavailable: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true partition: - description: Partition indicates the ordinal at which - the StatefulSet should be partitioned. Default value - is 0. format: int32 type: integer type: object type: - description: Type indicates the type of the StatefulSetUpdateStrategy. - Default is RollingUpdate. type: string type: object volumeClaimTemplates: - description: 'volumeClaimTemplates is a list of claims that - pods are allowed to reference. The StatefulSet controller - is responsible for mapping network identities to claims - in a way that maintains the identity of a pod. Every claim - in this list must have at least one matching (by name) volumeMount - in one container in the template. A claim in this list takes - precedence over any volumes in the template, with the same - name. TODO: Define the behavior if a claim already exists - with the same name.' items: - description: PersistentVolumeClaim is a user's request for - and claim to a persistent volume properties: apiVersion: - description: 'APIVersion defines the versioned schema - of this representation of an object. Servers should - convert recognized schemas to the latest internal - value, and may reject unrecognized values. More info: - https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the - REST resource this object represents. Servers may - infer this from the endpoint the client submits requests - to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: - description: 'Standard object''s metadata. More info: - https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' properties: annotations: additionalProperties: @@ -7870,94 +3307,38 @@ spec: type: string type: object spec: - description: 'Spec defines the desired characteristics - of a volume requested by a pod author. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. If the AnyVolumeDataSource feature - gate is enabled, this field will always have the - same contents as the DataSourceRef field.' properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. type: string kind: - description: Kind is the type of resource being - referenced type: string name: - description: Name is the name of resource being - referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'Specifies the object from which to - populate the volume with data, if a non-empty - volume is desired. This may be any local object - from a non-empty API group (non core object) or - a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - DataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, both fields (DataSource - and DataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. There are two important differences - between DataSource and DataSourceRef: * While - DataSource only allows two specific types of objects, - DataSourceRef allows any non-core object, as - well as PersistentVolumeClaim objects. * While - DataSource ignores disallowed values (dropping - them), DataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - (Alpha) Using this field requires the AnyVolumeDataSource - feature gate to be enabled.' properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. type: string kind: - description: Kind is the type of resource being - referenced type: string name: - description: Name is the name of resource being - referenced type: string required: - kind - name type: object + x-kubernetes-map-type: atomic resources: - description: 'Resources represents the minimum resources - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -7966,8 +3347,6 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -7976,46 +3355,18 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum - amount of compute resources required. If Requests - is omitted for a container, it defaults to - Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: A label query over volumes to consider - for binding. properties: matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. properties: key: - description: key is the label key that - the selector applies to. type: string operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. type: string values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. items: type: string type: array @@ -8027,40 +3378,30 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object type: object + x-kubernetes-map-type: atomic storageClassName: - description: 'Name of the StorageClass required - by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. type: string volumeName: - description: VolumeName is the binding reference - to the PersistentVolume backing this claim. type: string type: object status: - description: 'Status represents the current information/status - of a persistent volume claim. Read-only. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the actual access - modes the volume backing the PVC has. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object capacity: additionalProperties: anyOf: @@ -8068,43 +3409,23 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: Represents the actual resources of - the underlying volume. type: object conditions: - description: Current Condition of persistent volume - claim. If underlying persistent volume is being - resized then the Condition will be set to 'ResizeStarted'. items: - description: PersistentVolumeClaimCondition contails - details about state of pvc properties: lastProbeTime: - description: Last time we probed the condition. format: date-time type: string lastTransitionTime: - description: Last time the condition transitioned - from one status to another. format: date-time type: string message: - description: Human-readable message indicating - details about last transition. type: string reason: - description: Unique, this should be a short, - machine understandable string that gives - the reason for condition's last transition. - If it reports "ResizeStarted" that means - the underlying persistent volume is being - resized. type: string status: type: string type: - description: PersistentVolumeClaimConditionType - is a valid value of PersistentVolumeClaimCondition.Type type: string required: - status @@ -8112,8 +3433,8 @@ spec: type: object type: array phase: - description: Phase represents the current phase - of PersistentVolumeClaim. + type: string + resizeStatus: type: string type: object type: object @@ -8124,22 +3445,3401 @@ spec: - template type: object status: - description: ReplicasetTemplateStatus defines the observed state - of ReplicasetTemplate type: object type: object type: object status: - description: RoleStatus defines the observed state of Role type: object type: object + served: false + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .status.replicasets + name: Replicasets + priority: 1 + type: number + - jsonPath: .status.readyReplicasets + name: Ready replicasets + priority: 1 + type: number + - jsonPath: .status.replicas + name: Replicas + priority: 1 + type: number + - jsonPath: .status.readyReplicas + name: Ready replicas + priority: 1 + type: number + - jsonPath: .status.weight + name: Weight + type: number + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + allRw: + type: boolean + replicasetTemplate: + properties: + minReadySeconds: + default: 0 + format: int32 + type: integer + podTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + type: string + required: + - name + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: atomic + os: + properties: + name: + type: string + required: + - name + type: object + overhead: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + required: + - conditionType + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + required: + - containers + type: object + type: object + replicas: + default: 1 + format: int32 + type: integer + volumeClaimTemplates: + items: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + type: array + phase: + type: string + resizeStatus: + type: string + type: object + type: object + type: array + type: object + replicasets: + default: 1 + format: int32 + type: integer + vshard: + properties: + clusterRoles: + items: + type: string + type: array + vshardGroupName: + default: default + type: string + weight: + default: 100 + format: int32 + type: integer + required: + - clusterRoles + type: object + required: + - replicasetTemplate + - vshard + type: object + status: + properties: + phase: + default: Pending + type: string + required: + - phase + type: object + required: + - metadata + type: object served: true storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index adf83ba2..570cd53f 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -3,23 +3,23 @@ # It should be run by config/default resources: - bases/tarantool.io_clusters.yaml -- bases/tarantool.io_replicasettemplates.yaml - bases/tarantool.io_roles.yaml +- bases/tarantool.io_cartridgeconfigs.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD #- patches/webhook_in_clusters.yaml -#- patches/webhook_in_replicasettemplates.yaml #- patches/webhook_in_roles.yaml +#- patches/webhook_in_cartridgeconfigs.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD #- patches/cainjection_in_clusters.yaml -#- patches/cainjection_in_replicasettemplates.yaml #- patches/cainjection_in_roles.yaml +#- patches/cainjection_in_cartridgeconfigs.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_replicasettemplates.yaml b/config/crd/patches/cainjection_in_cartridgeconfigs.yaml similarity index 86% rename from config/crd/patches/cainjection_in_replicasettemplates.yaml rename to config/crd/patches/cainjection_in_cartridgeconfigs.yaml index 42b984b0..6715aa95 100644 --- a/config/crd/patches/cainjection_in_replicasettemplates.yaml +++ b/config/crd/patches/cainjection_in_cartridgeconfigs.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: replicasettemplates.tarantool.io + name: cartridgeconfigs.tarantool.io diff --git a/config/crd/patches/webhook_in_replicasettemplates.yaml b/config/crd/patches/webhook_in_cartridgeconfigs.yaml similarity index 84% rename from config/crd/patches/webhook_in_replicasettemplates.yaml rename to config/crd/patches/webhook_in_cartridgeconfigs.yaml index d562daf0..e5b239a0 100644 --- a/config/crd/patches/webhook_in_replicasettemplates.yaml +++ b/config/crd/patches/webhook_in_cartridgeconfigs.yaml @@ -2,8 +2,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: replicasettemplates.tarantool.io + name: cartridgeconfigs.tarantool.io spec: + preserveUnknownFields: true conversion: strategy: Webhook webhook: diff --git a/config/crd/patches/webhook_in_clusters.yaml b/config/crd/patches/webhook_in_clusters.yaml index ff1cd780..822ae59e 100644 --- a/config/crd/patches/webhook_in_clusters.yaml +++ b/config/crd/patches/webhook_in_clusters.yaml @@ -4,6 +4,7 @@ kind: CustomResourceDefinition metadata: name: clusters.tarantool.io spec: + preserveUnknownFields: true conversion: strategy: Webhook webhook: diff --git a/config/crd/patches/webhook_in_roles.yaml b/config/crd/patches/webhook_in_roles.yaml index 9dc4481a..652b925d 100644 --- a/config/crd/patches/webhook_in_roles.yaml +++ b/config/crd/patches/webhook_in_roles.yaml @@ -4,6 +4,7 @@ kind: CustomResourceDefinition metadata: name: roles.tarantool.io spec: + preserveUnknownFields: true conversion: strategy: Webhook webhook: diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index d7234d2d..2c6df7e2 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -3,7 +3,7 @@ namespace: tarantool-operator-system # Value of this field is prepended to the # names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". +# "tarantool-operator" becomes "alices-tarantool-operator". # Note that it should also match with the prefix (text before '-') of the namespace # field above. namePrefix: tarantool-operator- diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 4e2232fa..cec149a0 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -10,16 +10,28 @@ spec: spec: containers: - name: kube-rbac-proxy - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 args: - "--secure-listen-address=0.0.0.0:8443" - "--upstream=http://127.0.0.1:8080/" - "--logtostderr=true" - - "--v=10" + - "--v=0" ports: - containerPort: 8443 protocol: TCP name: https + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 5m + memory: 64Mi - name: manager args: - "--health-probe-bind-address=:8081" diff --git a/config/manager/controller_manager_config.yaml b/config/manager/controller_manager_config.yaml index 8be3a3da..0087e6e9 100644 --- a/config/manager/controller_manager_config.yaml +++ b/config/manager/controller_manager_config.yaml @@ -1,4 +1,4 @@ -apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 +apiVersion: controller-runtime.sigs.k8s.io/v1beta1 kind: ControllerManagerConfig health: healthProbeBindAddress: :8081 @@ -8,4 +8,14 @@ webhook: port: 9443 leaderElection: leaderElect: true - resourceName: 0f93ee2c.tarantool.io + resourceName: 0f9ee2c.tarantool.io +# leaderElectionReleaseOnCancel defines if the leader should step down volume +# when the Manager ends. This requires the binary to immediately end when the +# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly +# speeds up voluntary leader transitions as the new leader don't have to wait +# LeaseDuration time first. +# In the default scaffold provided, the program ends immediately after +# the manager stops, so would be fine to enable this option. However, +# if you are doing or is intended to do any operation such as perform cleanups +# after the manager stops then its usage might be unsafe. +# leaderElectionReleaseOnCancel: true diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 4a1a6852..2bcd3eea 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,12 +5,6 @@ generatorOptions: disableNameSuffixHash: true configMapGenerator: -- files: +- name: manager-config + files: - controller_manager_config.yaml - name: manager-config -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -images: -- name: controller - newName: tarantool-operator - newTag: 0.0.9 diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index db096284..878ad486 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -19,21 +19,32 @@ spec: replicas: 1 template: metadata: + annotations: + kubectl.kubernetes.io/default-container: manager labels: control-plane: controller-manager spec: securityContext: runAsNonRoot: true + # TODO(user): For common cases that do not require escalating privileges + # it is recommended to ensure that all your Pods/Containers are restrictive. + # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted + # Please uncomment the following code if your project does NOT have to work on old Kubernetes + # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ). + # seccompProfile: + # type: RuntimeDefault containers: - command: - /manager args: - --leader-elect image: controller:latest - imagePullPolicy: IfNotPresent name: manager securityContext: allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" livenessProbe: httpGet: path: /healthz @@ -46,12 +57,14 @@ spec: port: 8081 initialDelaySeconds: 5 periodSeconds: 10 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ resources: limits: - cpu: 200m - memory: 100Mi + cpu: 500m + memory: 128Mi requests: - cpu: 100m - memory: 20Mi + cpu: 10m + memory: 64Mi serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index b304a905..be486c8a 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -1,10 +1,10 @@ # These resources constitute the fully configured set of manifests # used to generate the 'manifests/' directory in a bundle. resources: -- bases/tarantool-operator.clusterserviceversion.yaml -- ../default -- ../samples -- ../scorecard + - bases/tarantool-operator-ce.clusterserviceversion.yaml + - ../default + - ../samples + - ../scorecard # [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. # Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. diff --git a/config/rbac/replicasettemplate_editor_role.yaml b/config/rbac/cartridgeconfig_editor_role.yaml similarity index 63% rename from config/rbac/replicasettemplate_editor_role.yaml rename to config/rbac/cartridgeconfig_editor_role.yaml index f720a461..e7be98b1 100644 --- a/config/rbac/replicasettemplate_editor_role.yaml +++ b/config/rbac/cartridgeconfig_editor_role.yaml @@ -1,13 +1,13 @@ -# permissions for end users to edit replicasettemplates. +# permissions for end users to edit cartridgeconfigs. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: replicasettemplate-editor-role + name: cartridgeconfig-editor-role rules: - apiGroups: - tarantool.io resources: - - replicasettemplates + - cartridgeconfigs verbs: - create - delete @@ -19,6 +19,6 @@ rules: - apiGroups: - tarantool.io resources: - - replicasettemplates/status + - cartridgeconfigs/status verbs: - get diff --git a/config/rbac/replicasettemplate_viewer_role.yaml b/config/rbac/cartridgeconfig_viewer_role.yaml similarity index 58% rename from config/rbac/replicasettemplate_viewer_role.yaml rename to config/rbac/cartridgeconfig_viewer_role.yaml index 0fb408c5..9eef2286 100644 --- a/config/rbac/replicasettemplate_viewer_role.yaml +++ b/config/rbac/cartridgeconfig_viewer_role.yaml @@ -1,13 +1,13 @@ -# permissions for end users to view replicasettemplates. +# permissions for end users to view cartridgeconfigs. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: replicasettemplate-viewer-role + name: cartridgeconfig-viewer-role rules: - apiGroups: - tarantool.io resources: - - replicasettemplates + - cartridgeconfigs verbs: - get - list @@ -15,6 +15,6 @@ rules: - apiGroups: - tarantool.io resources: - - replicasettemplates/status + - cartridgeconfigs/status verbs: - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 6757a58e..d110ddd2 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1,4 +1,3 @@ - --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -18,6 +17,30 @@ rules: - patch - update - watch +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - "" resources: @@ -33,7 +56,7 @@ rules: - apiGroups: - "" resources: - - services + - pods/exec verbs: - create - delete @@ -43,9 +66,25 @@ rules: - update - watch - apiGroups: - - apps + - "" resources: - - statefulsets + - pods/logs + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - services verbs: - create - delete @@ -55,9 +94,9 @@ rules: - update - watch - apiGroups: - - tarantool.io + - apps resources: - - clusters + - statefulsets verbs: - create - delete @@ -67,23 +106,33 @@ rules: - update - watch - apiGroups: - - tarantool.io + - "" resources: - - clusters/finalizers + - configmaps verbs: + - create + - delete + - get + - list + - patch - update + - watch - apiGroups: - - tarantool.io + - "" resources: - - clusters/status + - events verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - tarantool.io resources: - - replicasettemplates + - cartridgeconfigs verbs: - create - delete @@ -95,13 +144,13 @@ rules: - apiGroups: - tarantool.io resources: - - replicasettemplates/finalizers + - cartridgeconfigs/finalizers verbs: - update - apiGroups: - tarantool.io resources: - - replicasettemplates/status + - cartridgeconfigs/status verbs: - get - patch @@ -109,7 +158,7 @@ rules: - apiGroups: - tarantool.io resources: - - roles + - clusters verbs: - create - delete @@ -121,9 +170,23 @@ rules: - apiGroups: - tarantool.io resources: - - roles/finalizers + - clusters/status verbs: + - get + - patch - update +- apiGroups: + - tarantool.io + resources: + - roles + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - tarantool.io resources: diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 4372f0ab..eddf9987 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -3,4 +3,7 @@ resources: - tarantool.io_v1alpha1_cluster.yaml - tarantool.io_v1alpha1_replicasettemplate.yaml - tarantool.io_v1alpha1_role.yaml +- tarantool.io_v1beta1_cluster.yaml +- tarantool.io_v1beta1_role.yaml +- tarantool.io_v1beta1_cartridgeconfig.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/samples/tarantool.io_v1alpha2_cartridgeconfig.yaml b/config/samples/tarantool.io_v1alpha2_cartridgeconfig.yaml new file mode 100644 index 00000000..a0120652 --- /dev/null +++ b/config/samples/tarantool.io_v1alpha2_cartridgeconfig.yaml @@ -0,0 +1,6 @@ +apiVersion: tarantool.io/v1beta1 +kind: CartridgeConfig +metadata: + name: cartridgeconfig-sample +spec: + # TODO(user): Add fields here diff --git a/config/samples/tarantool.io_v1alpha2_cluster.yaml b/config/samples/tarantool.io_v1alpha2_cluster.yaml new file mode 100644 index 00000000..8c84e667 --- /dev/null +++ b/config/samples/tarantool.io_v1alpha2_cluster.yaml @@ -0,0 +1,6 @@ +apiVersion: tarantool.io/v1beta1 +kind: Cluster +metadata: + name: cluster-sample +spec: + # TODO(user): Add fields here diff --git a/config/samples/tarantool.io_v1alpha2_role.yaml b/config/samples/tarantool.io_v1alpha2_role.yaml new file mode 100644 index 00000000..264bd548 --- /dev/null +++ b/config/samples/tarantool.io_v1alpha2_role.yaml @@ -0,0 +1,6 @@ +apiVersion: tarantool.io/v1beta1 +kind: Role +metadata: + name: role-sample +spec: + # TODO(user): Add fields here diff --git a/controllers/cartridgeconfig_controller.go b/controllers/cartridgeconfig_controller.go new file mode 100644 index 00000000..8b4e4eff --- /dev/null +++ b/controllers/cartridgeconfig_controller.go @@ -0,0 +1,125 @@ +package controllers + +import ( + "context" + + "github.com/go-logr/logr" + . "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal" + "github.com/tarantool/tarantool-operator/internal/implementation" + . "github.com/tarantool/tarantool-operator/internal/steps" + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/common" + "github.com/tarantool/tarantool-operator/pkg/topology" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec/cli" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" +) + +//+kubebuilder:rbac:groups=tarantool.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=tarantool.io,resources=clusters/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=tarantool.io,resources=cartridgeconfigs,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=tarantool.io,resources=cartridgeconfigs/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=tarantool.io,resources=cartridgeconfigs/finalizers,verbs=update + +func NewCartridgeConfigReconciler(mgr Manager) *CartridgeConfigReconciler { + k8sConfig := mgr.GetConfig() + k8sClient := mgr.GetClient() + k8sScheme := mgr.GetScheme() + restClient, _ := apiutil.RESTClientForGVK( + schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + false, + k8sConfig, + serializer.NewCodecFactory(k8sScheme), + ) + + labelsManager := &k8s.NamespacedLabelsManager{ + Namespace: "tarantool.io", + } + resourcesManager := &implementation.ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: k8sClient, + Scheme: k8sScheme, + }, + } + eventsRecorder := events.NewRecorder(mgr.GetEventRecorderFor("cartridge-config-controller")) + luaTopology := &topology.CommonCartridgeTopology{ + Transport: &podexec.PodExec{ + RestClient: restClient, + RestConfig: k8sConfig, + RuntimeScheme: k8sScheme, + CLI: &cli.TarantoolCTL{}, + }, + } + + return &CartridgeConfigReconciler{ + SteppedReconciler: &SteppedReconciler[*CartridgeConfigContextCE, *CartridgeConfigControllerCE]{ + Client: k8sClient, + Controller: &CartridgeConfigControllerCE{ + CommonCartridgeConfigController: &CommonCartridgeConfigController{ + CommonController: &CommonController{ + Client: k8sClient, + Schema: k8sScheme, + LeaderElection: &election.LeaderElection{ + Client: k8sClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + EventsRecorder: eventsRecorder, + Topology: luaTopology, + LabelsManager: labelsManager, + }, + }, + }, + }, + } +} + +// CartridgeConfigReconciler reconciles a Config object. +type CartridgeConfigReconciler struct { + *SteppedReconciler[*CartridgeConfigContextCE, *CartridgeConfigControllerCE] +} + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +func (r *CartridgeConfigReconciler) Reconcile(ctx context.Context, req Request) (Result, error) { + return r.Run( + &CartridgeConfigContextCE{ + CommonContext: &CommonContext{ + Context: ctx, + Request: req, + Logger: logr.FromContextOrDiscard(ctx), + }, + }, + Info[*CartridgeConfigContextCE, *CartridgeConfigControllerCE]("Reconcile Config"), + GetRequestedObject[*CartridgeConfigContextCE, *CartridgeConfigControllerCE](&CartridgeConfig{}), + ResetCartridgeConfigStatus(), + SetCartridgeConfigPhase(CartridgeConfigWaitingForCluster), + GetClusterByLabels[*CartridgeConfigContextCE, *CartridgeConfigControllerCE](), + WaitForClusterBootstrapped[*CartridgeConfigContextCE, *CartridgeConfigControllerCE](), + SetCartridgeConfigPhase(CartridgeConfigWaitingForLeader), + GetLeader[*CartridgeConfigContextCE, *CartridgeConfigControllerCE](), + SetCartridgeConfigPhase(CartridgeConfigApplying), + ConfigureCartridge(), + SetCartridgeConfigPhase(CartridgeConfigReady), + Info[*CartridgeConfigContextCE, *CartridgeConfigControllerCE]("CartridgeConfig ready"), + ) +} + +// SetupWithManager sets up the controller with the Manager. +func (r *CartridgeConfigReconciler) SetupWithManager(mgr Manager) error { + return NewControllerManagedBy(mgr). + For(&CartridgeConfig{}). + Complete(r) +} diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index 9e85d0b4..ac1c8781 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -1,465 +1,167 @@ -/* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - package controllers import ( "context" - "fmt" - "strings" - "time" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + "github.com/go-logr/logr" + . "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal" + . "github.com/tarantool/tarantool-operator/internal/implementation" + . "github.com/tarantool/tarantool-operator/internal/steps" + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/common" + "github.com/tarantool/tarantool-operator/pkg/topology" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec/cli" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/google/uuid" - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" - "github.com/tarantool/tarantool-operator/controllers/tarantool" - "github.com/tarantool/tarantool-operator/controllers/topology" - "github.com/tarantool/tarantool-operator/controllers/utils" ) -var space = uuid.MustParse("73692FF6-EB42-46C2-92B6-65C45191368D") - -// ClusterReconciler reconciles a Cluster object -type ClusterReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -// Checking for a leader in the cluster Endpoint annotation -func IsLeaderExists(ep *corev1.Endpoints) bool { - leader, ok := ep.Annotations["tarantool.io/leader"] - if !ok || leader == "" { - return false - } - - for _, addr := range ep.Subsets[0].Addresses { - if leader == fmt.Sprintf("%s:%s", addr.IP, "8081") { - return true - } - } - return false -} - -// HasInstanceUUID . -func HasInstanceUUID(o *corev1.Pod) bool { - annotations := o.Labels - if _, ok := annotations["tarantool.io/instance-uuid"]; ok { - return true - } - - return false -} - -// SetInstanceUUID . -func SetInstanceUUID(o *corev1.Pod) *corev1.Pod { - labels := o.Labels - if len(o.GetName()) == 0 { - return o - } - instanceUUID := uuid.NewSHA1(space, []byte(o.GetName())) - labels["tarantool.io/instance-uuid"] = instanceUUID.String() - - o.SetLabels(labels) - return o -} - //+kubebuilder:rbac:groups=tarantool.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=tarantool.io,resources=clusters/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=tarantool.io,resources=clusters/finalizers,verbs=update //+kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups=core,resources=events,verbs=get;create;update;watch;list;patch;delete //+kubebuilder:rbac:groups="",resources=pods,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups="",resources=pods/exec,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups="",resources=pods/logs,verbs=get;watch;list; //+kubebuilder:rbac:groups="",resources=services,verbs=get;create;update;watch;list;patch;delete //+kubebuilder:rbac:groups="",resources=endpoints,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups="",resources=persistentvolumes,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;create;update;watch;list;patch;delete +//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;watch;list + +func NewClusterReconciler(mgr Manager) *ClusterReconciler { + k8sConfig := mgr.GetConfig() + k8sClient := mgr.GetClient() + k8sScheme := mgr.GetScheme() + restClient, _ := apiutil.RESTClientForGVK( + schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + false, + k8sConfig, + serializer.NewCodecFactory(k8sScheme), + ) -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Cluster object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile -func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - reqLogger := log.FromContext(ctx) - reqLogger.Info("Reconciling Cluster") - - // do nothing if no Cluster - cluster := &tarantooliov1alpha1.Cluster{} - if err := r.Get(context.TODO(), req.NamespacedName, cluster); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - clusterSelector, err := metav1.LabelSelectorAsSelector(cluster.Spec.Selector) - if err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - roleList := &tarantooliov1alpha1.RoleList{} - if err := r.List(context.TODO(), roleList, &client.ListOptions{LabelSelector: clusterSelector, Namespace: req.NamespacedName.Namespace}); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - for _, role := range roleList.Items { - if metav1.IsControlledBy(&role, cluster) { - reqLogger.Info("Already owned", "Role.Name", role.Name) - continue - } - annotations := role.GetAnnotations() - if annotations == nil { - annotations = make(map[string]string) - } - annotations["tarantool.io/cluster-id"] = cluster.GetName() - role.SetAnnotations(annotations) - if err := controllerutil.SetControllerReference(cluster, &role, r.Scheme); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - if err := r.Update(context.TODO(), &role); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - reqLogger.Info("Set role ownership", "Role.Name", role.GetName(), "Cluster.Name", cluster.GetName()) - } - - reqLogger.Info("Roles reconciled, moving to pod reconcile") - - // ensure cluster wide Service exists - svc := &corev1.Service{} - if err := r.Get(context.TODO(), types.NamespacedName{Namespace: cluster.GetNamespace(), Name: cluster.GetName()}, svc); err != nil { - if errors.IsNotFound(err) { - svc.Name = cluster.GetName() - svc.Namespace = cluster.GetNamespace() - svc.Spec = corev1.ServiceSpec{ - PublishNotReadyAddresses: true, - Selector: cluster.Spec.Selector.MatchLabels, - ClusterIP: "None", - Ports: []corev1.ServicePort{ - { - Name: "app", - Port: 3301, - Protocol: "TCP", + labelsManager := &k8s.NamespacedLabelsManager{ + Namespace: "tarantool.io", + } + resourcesManager := &ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: k8sClient, + Scheme: k8sScheme, + }, + } + eventsRecorder := events.NewRecorder(mgr.GetEventRecorderFor("cluster-controller")) + luaTopology := &topology.CommonCartridgeTopology{ + Transport: &podexec.PodExec{ + RestClient: restClient, + RestConfig: k8sConfig, + RuntimeScheme: k8sScheme, + CLI: &cli.TarantoolCTL{}, + }, + } + + return &ClusterReconciler{ + LabelsManager: labelsManager, + SteppedReconciler: &SteppedReconciler[*ClusterContextCE, *ClusterControllerCE]{ + Client: k8sClient, + Controller: &ClusterControllerCE{ + CommonClusterController: &CommonClusterController{ + CommonController: &CommonController{ + Client: k8sClient, + Schema: k8sScheme, + LeaderElection: &election.LeaderElection{ + Client: k8sClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + EventsRecorder: eventsRecorder, + Topology: luaTopology, + LabelsManager: labelsManager, }, }, - } - - if err := controllerutil.SetControllerReference(cluster, svc, r.Scheme); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - if err := r.Create(context.TODO(), svc); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - } - } - - // ensure Cluster leader elected - ep := &corev1.Endpoints{} - if err := r.Get(context.TODO(), types.NamespacedName{Namespace: cluster.GetNamespace(), Name: cluster.GetName()}, ep); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - if len(ep.Subsets) == 0 || len(ep.Subsets[0].Addresses) == 0 { - reqLogger.Info("No available Endpoint resource configured for Cluster, waiting") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - if !IsLeaderExists(ep) { - leader := fmt.Sprintf("%s:%s", ep.Subsets[0].Addresses[0].IP, "8081") - - if ep.Annotations == nil { - ep.Annotations = make(map[string]string) - } - - ep.Annotations["tarantool.io/leader"] = leader - if err := r.Update(context.TODO(), ep); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } + }, + }, } +} - stsList := &appsv1.StatefulSetList{} - if err := r.List(context.TODO(), stsList, &client.ListOptions{LabelSelector: clusterSelector, Namespace: req.NamespacedName.Namespace}); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } +// ClusterReconciler reconciles a ClusterCE object. +type ClusterReconciler struct { + *SteppedReconciler[*ClusterContextCE, *ClusterControllerCE] - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } + LabelsManager k8s.LabelsManager +} - topologyClient := topology.NewBuiltInTopologyService( - topology.WithTopologyEndpoint(fmt.Sprintf("http://%s/admin/api", ep.Annotations["tarantool.io/leader"])), - topology.WithClusterID(cluster.GetName()), +func (r *ClusterReconciler) Reconcile(ctx context.Context, req Request) (Result, error) { + return r.Run( + &ClusterContextCE{ + CommonContext: &CommonContext{ + Context: ctx, + Request: req, + Logger: logr.FromContextOrDiscard(ctx), + }, + }, + Info[*ClusterContextCE, *ClusterControllerCE]("Reconcile cluster"), + GetRequestedObject[*ClusterContextCE, *ClusterControllerCE](&Cluster{}), + SetClusterPhase(ClusterPending), + CheckClusterDeletion(), + ResetClusterStatus(), + SetClusterPhase(ClusterSyncingService), + SyncClusterWideService(), + SetClusterPhase(ClusterWaitingForRoles), + WaitForRolesPhases(RoleWaitingForBootstrap, RoleReady), + Info[*ClusterContextCE, *ClusterControllerCE]("All roles ready, we are going to bootstrap cluster"), + SetClusterPhase(ClusterWaitingForLeader), + GetLeader[*ClusterContextCE, *ClusterControllerCE](), + Bootstrap(BootstrapParams{ + OnError: ClusterUnableToBootstrap, + }), + SetClusterPhase(ClusterFailoverConfiguring), + ConfigureFailover(), + SetClusterPhase(ClusterReady), + Info[*ClusterContextCE, *ClusterControllerCE]("Community cluster ready"), ) - - for _, sts := range stsList.Items { - for i := 0; i < int(*sts.Spec.Replicas); i++ { - pod := &corev1.Pod{} - name := types.NamespacedName{ - Namespace: req.Namespace, - Name: fmt.Sprintf("%s-%d", sts.GetName(), i), - } - if err := r.Get(context.TODO(), name, pod); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - podLogger := reqLogger.WithValues("Pod.Name", pod.GetName()) - if HasInstanceUUID(pod) { - continue - } - podLogger.Info("starting: set instance uuid") - pod = SetInstanceUUID(pod) - - if err := r.Update(context.TODO(), pod); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - podLogger.Info("success: set instance uuid", "UUID", pod.GetLabels()["tarantool.io/instance-uuid"]) - return ctrl.Result{Requeue: true}, nil - } - - for i := 0; i < int(*sts.Spec.Replicas); i++ { - pod := &corev1.Pod{} - name := types.NamespacedName{ - Namespace: req.Namespace, - Name: fmt.Sprintf("%s-%d", sts.GetName(), i), - } - if err := r.Get(context.TODO(), name, pod); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - if tarantool.IsJoined(pod) { - continue - } - - if err := topologyClient.Join(pod); err != nil { - if topology.IsAlreadyJoined(err) { - tarantool.MarkJoined(pod) - if err := r.Update(context.TODO(), pod); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - reqLogger.Info("Already joined", "Pod.Name", pod.Name) - continue - } - - if topology.IsTopologyDown(err) { - reqLogger.Info("Topology is down", "Pod.Name", pod.Name) - continue - } - - reqLogger.Error(err, "Join error") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } else { - tarantool.MarkJoined(pod) - if err := r.Update(context.TODO(), pod); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - } - - for _, sts := range stsList.Items { - stsAnnotations := sts.GetAnnotations() - weight := stsAnnotations["tarantool.io/replicaset-weight"] - - if weight == "0" { - reqLogger.Info("weight is set to 0, checking replicaset buckets for scheduled deletion") - data, err := topologyClient.GetServerStat() - if err != nil { - reqLogger.Error(err, "failed to get server stats") - } else { - for i := 0; i < len(data.Stats); i++ { - if strings.HasPrefix(data.Stats[i].URI, sts.GetName()) { - reqLogger.Info("Found statefulset to check for buckets count", "sts.Name", sts.GetName()) - - bucketsCount := data.Stats[i].Statistics.BucketsCount - if bucketsCount == 0 { - reqLogger.Info("replicaset has migrated all of its buckets away, schedule to remove", "sts.Name", sts.GetName()) - - stsAnnotations["tarantool.io/scheduledDelete"] = "1" - sts.SetAnnotations(stsAnnotations) - if err := r.Update(context.TODO(), &sts); err != nil { - reqLogger.Error(err, "failed to set scheduled deletion annotation") - } - } else { - reqLogger.Info("replicaset still has buckets, retry checking on next run", "sts.Name", sts.GetName(), "buckets", bucketsCount) - } - } - } - } - } - - for i := 0; i < int(*sts.Spec.Replicas); i++ { - pod := &corev1.Pod{} - name := types.NamespacedName{ - Namespace: req.Namespace, - Name: fmt.Sprintf("%s-%d", sts.GetName(), i), - } - - if err := r.Get(context.TODO(), name, pod); err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - if !tarantool.IsJoined(pod) { - reqLogger.Info("Not all instances joined, skip weight change", "StatefulSet.Name", sts.GetName()) - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - } - - if err := topologyClient.SetWeight(sts.GetLabels()["tarantool.io/replicaset-uuid"], weight); err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - } - - for _, sts := range stsList.Items { - replicasetUUID := sts.GetLabels()["tarantool.io/replicaset-uuid"] - - actualRoles, err := topologyClient.GetReplicasetRolesFromService(replicasetUUID) - if err != nil { - reqLogger.Error(err, "Getting roles from server") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - desireRoles, err := topology.GetRoles(&sts.ObjectMeta) - if err != nil { - reqLogger.Error(err, "Getting roles from statefulset") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - - if utils.IsRolesEquals(actualRoles, desireRoles) { - continue - } - reqLogger.Info("Update replicaset roles", "id", replicasetUUID, "from", actualRoles, "to", desireRoles) - - err = topologyClient.SetReplicasetRoles(replicasetUUID, desireRoles) - if err != nil { - reqLogger.Error(err, "Setting new replicaset roles") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - } - - for _, sts := range stsList.Items { - stsAnnotations := sts.GetAnnotations() - if stsAnnotations["tarantool.io/isBootstrapped"] != "1" { - reqLogger.Info("cluster is not bootstrapped, bootstrapping", "Statefulset.Name", sts.GetName()) - if err := topologyClient.BootstrapVshard(); err != nil { - if topology.IsAlreadyBootstrapped(err) { - stsAnnotations["tarantool.io/isBootstrapped"] = "1" - sts.SetAnnotations(stsAnnotations) - - if err := r.Update(context.TODO(), &sts); err != nil { - reqLogger.Error(err, "failed to set bootstrapped annotation") - } - - reqLogger.Info("Added bootstrapped annotation", "StatefulSet.Name", sts.GetName()) - - cluster.Status.State = "Ready" - err = r.Status().Update(context.TODO(), cluster) - if err != nil { - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil - } - - reqLogger.Error(err, "Bootstrap vshard error") - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, err - } - } else { - reqLogger.Info("cluster is already bootstrapped, not retrying", "Statefulset.Name", sts.GetName()) - } - - if stsAnnotations["tarantool.io/failoverEnabled"] == "1" { - reqLogger.Info("failover is enabled, not retrying") - } else { - if err := topologyClient.SetFailover(true); err != nil { - reqLogger.Error(err, "failed to enable cluster failover") - } else { - reqLogger.Info("enabled failover") - - stsAnnotations["tarantool.io/failoverEnabled"] = "1" - sts.SetAnnotations(stsAnnotations) - if err := r.Update(context.TODO(), &sts); err != nil { - reqLogger.Error(err, "failed to set failover enabled annotation") - } - } - } - } - - return ctrl.Result{RequeueAfter: time.Duration(5 * time.Second)}, nil } // SetupWithManager sets up the controller with the Manager. -func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&tarantooliov1alpha1.Cluster{}). - Watches(&source.Kind{Type: &tarantooliov1alpha1.Cluster{}}, &handler.EnqueueRequestForObject{}). - Watches(&source.Kind{Type: &corev1.Pod{}}, handler.EnqueueRequestsFromMapFunc(func(a client.Object) []reconcile.Request { - if a.GetLabels() == nil { - return []ctrl.Request{} - } - return []ctrl.Request{ - {NamespacedName: types.NamespacedName{ - Namespace: a.GetNamespace(), - Name: a.GetLabels()["tarantool.io/cluster-id"], - }}, +func (r *ClusterReconciler) SetupWithManager(mgr Manager) error { + return NewControllerManagedBy(mgr). + For(&Cluster{}). + Owns(&v1.Service{}). + Watches(&source.Kind{Type: &Role{}}, handler.EnqueueRequestsFromMapFunc(func(obj client.Object) []reconcile.Request { + role, ok := obj.(*Role) + if !ok { + return []Request{} + } + + if labels := role.GetLabels(); role.Status.Phase == RoleWaitingForBootstrap && labels != nil { + return []Request{ + { + NamespacedName: types.NamespacedName{ + Namespace: role.GetNamespace(), + Name: labels[r.LabelsManager.ClusterName()], + }, + }, + } } + + return []Request{} })). Complete(r) } diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index b3901206..1188d0e1 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -1,211 +1,286 @@ -package controllers +package controllers_test import ( "context" "fmt" - "math/rand" - "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/stretchr/testify/mock" + "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/controllers" + . "github.com/tarantool/tarantool-operator/internal" + . "github.com/tarantool/tarantool-operator/internal/implementation" + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "github.com/tarantool/tarantool-operator/pkg/topology" + "github.com/tarantool/tarantool-operator/test/mocks" + "github.com/tarantool/tarantool-operator/test/resources" + "github.com/tarantool/tarantool-operator/test/utils" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client/fake" +) - helpers "github.com/tarantool/tarantool-operator/test/helpers" +var _ = Describe("cluster_controller unit testing", func() { + var ( + ctx = context.Background() + namespace = "default" + clusterName string + ) - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + BeforeEach(func() { + clusterName = fmt.Sprintf("cluster-%s", utils.RandStringRunes(4)) + }) - "sigs.k8s.io/controller-runtime/pkg/client" -) + Context("Common logic", func() { + Describe("cluster controller should reconcile deletion", func() { + It("must accept and process request with cluster which does not exists", func() { + fakeClient := fake.NewClientBuilder().Build() + fakeTopologyService := new(mocks.FakeCartridgeTopology) -var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz") + labelsManager := &k8s.NamespacedLabelsManager{ + Namespace: "tarantool.io", + } -func RandStringRunes(n int) string { - b := make([]rune, n) - for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] - } - return string(b) -} + resourcesManager := &ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: fakeClient, + Scheme: scheme.Scheme, + }, + } -var _ = Describe("cluster_controller unit testing", func() { - var ( - ctx = context.TODO() - namespace = "test" - clusterName = "test" - clusterId = "test" - ns = &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - } - cartridge = helpers.NewCartridge(helpers.CartridgeParams{ - Namespace: namespace, - ClusterName: clusterName, - ClusterID: clusterId, + eventsRecorder := events.NewRecorder(record.NewFakeRecorder(10)) + + clusterReconciler := &ClusterReconciler{ + LabelsManager: labelsManager, + SteppedReconciler: &reconciliation.SteppedReconciler[*ClusterContextCE, *ClusterControllerCE]{ + Client: fakeClient, + Controller: &ClusterControllerCE{ + CommonClusterController: &reconciliation.CommonClusterController{ + CommonController: &reconciliation.CommonController{ + Client: fakeClient, + Schema: scheme.Scheme, + LeaderElection: &election.LeaderElection{ + Client: fakeClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + LabelsManager: labelsManager, + EventsRecorder: eventsRecorder, + Topology: fakeTopologyService, + }, + }, + }, + }, + } + + reconcile, err := clusterReconciler.Reconcile(ctx, utils.ReconcileRequest(namespace, clusterName)) + if err != nil { + return + } + + Expect(err).NotTo(HaveOccurred(), "an error during reconcile") + Expect(reconcile.Requeue).To(BeFalse(), "should not be re-queued") + Expect(reconcile.RequeueAfter).To(BeZero(), "should not be re-queued") + }) }) - ) + }) - Describe("cluster_controller manage cluster resources", func() { - BeforeEach(func() { - Expect(k8sClient.Create(ctx, ns)). - NotTo( - HaveOccurred(), - fmt.Sprintf("failed to create Namespace %s", ns.GetName()), - ) - - Expect(k8sClient.Create(ctx, cartridge.Cluster)). - NotTo( - HaveOccurred(), - fmt.Sprintf("failed to create Cluster %s", cartridge.Cluster.GetName()), - ) - - for _, role := range cartridge.Roles { - Expect(k8sClient.Create(ctx, role)). - NotTo( - HaveOccurred(), - fmt.Sprintf("failed to create Role %s", role.GetName()), - ) + Context("cluster bootstrapping", func() { + Describe("cluster should control vshard bootstrapping", func() { + var cartridge *resources.FakeCartridge + var fakeTopologyService *mocks.FakeCartridgeTopology + labelsManager := &k8s.NamespacedLabelsManager{ + Namespace: "tarantool.io", } - for _, rs := range cartridge.ReplicasetTemplates { - Expect(k8sClient.Create(ctx, rs)). - NotTo( - HaveOccurred(), - fmt.Sprintf("failed to create ReplicasetTemplate %s", rs.GetName()), - ) - } + BeforeEach(func() { + cartridge = resources.NewFakeCartridge(labelsManager). + WithNamespace(namespace). + WithClusterName(clusterName). + WithRouterRole(2, 1). + WithStorageRole(2, 3). + WithRouterStatefulSetsCreated(). + WithStorageStatefulSetsCreated(). + WithRouterPodsCreated(). + WithStoragePodsCreated() - for _, svc := range cartridge.Services { - Expect(k8sClient.Create(ctx, svc)). - NotTo( - HaveOccurred(), - fmt.Sprintf("failed to create Service %s", svc.GetName()), - ) - } - }) + fakeTopologyService = new(mocks.FakeCartridgeTopology) - AfterEach(func() { - By("remove Namespace object " + namespace) - ns := &corev1.Namespace{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: namespace}, ns), - ).NotTo(HaveOccurred(), "failed to get Namespace") + fakeTopologyService. + On("BootstrapVshard", mock.Anything). + Return(nil) + }) - Expect(k8sClient.Delete(ctx, ns)).NotTo(HaveOccurred(), "failed to delete Namespace") - }) + It("Must bootstrap cluster if all roles ready", func() { + cartridge. + WithAllRolesInPhase(v1beta1.RoleWaitingForBootstrap). + WithAllPodsReady() + + fakeTopologyService. + On("BootstrapVshard", mock.Anything, mock.Anything). + Return(nil). + Once() + + fakeClient := cartridge.BuildFakeClient() - Context("manage cluster leader: tarantool instance accepting admin requests", func() { - It("change the leader if the previous one does not exist", func() { - By("get the chosen leader") - ep := corev1.Endpoints{} - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: clusterName, Namespace: namespace}, &ep) - if err != nil { - return false - } - - if ep.GetAnnotations()["tarantool.io/leader"] != "" { - return true - } - - return false + resourcesManager := &ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: fakeClient, + Scheme: scheme.Scheme, }, - 2*time.Minute, - 500*time.Millisecond, - ).Should(BeTrue()) - - By("save old leader") - oldLeader := ep.GetAnnotations()["tarantool.io/leader"] - - By("set all new IP addresses") - ep.Subsets = []corev1.EndpointSubset{ - { - Addresses: []corev1.EndpointAddress{ - {IP: "4.4.4.4"}, - {IP: "5.5.5.5"}, - {IP: "6.6.6.6"}, + } + + fakeTopologyService. + On("GetFailoverParams", mock.Anything, mock.Anything). + Return(&topology.FailoverParams{}, nil) + + eventsRecorder := events.NewRecorder(record.NewFakeRecorder(10)) + + clusterReconciler := &ClusterReconciler{ + LabelsManager: labelsManager, + SteppedReconciler: &reconciliation.SteppedReconciler[*ClusterContextCE, *ClusterControllerCE]{ + Client: fakeClient, + Controller: &ClusterControllerCE{ + CommonClusterController: &reconciliation.CommonClusterController{ + CommonController: &reconciliation.CommonController{ + Client: fakeClient, + Schema: scheme.Scheme, + LeaderElection: &election.LeaderElection{ + Client: fakeClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + LabelsManager: labelsManager, + EventsRecorder: eventsRecorder, + Topology: fakeTopologyService, + }, + }, }, }, } - Expect(k8sClient.Update(ctx, &ep)).NotTo(HaveOccurred(), "failed to update cluster endpoints") - - By("check that the leader has changed") - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: clusterId, Namespace: namespace}, &ep) - if err != nil { - return false - } - - if ep.GetAnnotations()["tarantool.io/leader"] != oldLeader { - return true - } - return false + _, err := clusterReconciler.Reconcile(ctx, ctrl.Request{ + NamespacedName: types.NamespacedName{ + Namespace: namespace, + Name: clusterName, }, - 2*time.Minute, - 500*time.Millisecond, - ).Should(BeTrue()) + }) + Expect(err).NotTo(HaveOccurred(), "an error during reconcile") + + err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: clusterName}, cartridge.Cluster) + Expect(err).NotTo(HaveOccurred(), "cluster gone") + + Expect(cartridge.Cluster.Status.Bootstrapped).To(BeTrue(), "cluster not bootstrapped") }) - }) - }) - Describe("cluster_controller unit testing functions", func() { - Describe("function IsLeaderExists must check for existence of leader in annotation of cluster Endpoints", func() { - Context("positive cases (leader exist)", func() { - It("should return True if leader assigned and exist", func() { - leaderIP := "1.1.1.1" - - ep := &corev1.Endpoints{ - ObjectMeta: metav1.ObjectMeta{ - Name: "name", - Namespace: "namespace", - Annotations: map[string]string{ - "tarantool.io/leader": fmt.Sprintf("%s:8081", leaderIP), - }, - }, - Subsets: []corev1.EndpointSubset{ - { - Addresses: []corev1.EndpointAddress{ - {IP: leaderIP}, + It("Must NOT bootstrap cluster if NOT all roles ready", func() { + fakeClient := cartridge.BuildFakeClient() + + resourcesManager := &ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: fakeClient, + Scheme: scheme.Scheme, + }, + } + + eventsRecorder := events.NewRecorder(record.NewFakeRecorder(10)) + + clusterReconciler := &ClusterReconciler{ + LabelsManager: labelsManager, + SteppedReconciler: &reconciliation.SteppedReconciler[*ClusterContextCE, *ClusterControllerCE]{ + Client: fakeClient, + Controller: &ClusterControllerCE{ + CommonClusterController: &reconciliation.CommonClusterController{ + CommonController: &reconciliation.CommonController{ + Client: fakeClient, + Schema: scheme.Scheme, + LeaderElection: &election.LeaderElection{ + Client: fakeClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + LabelsManager: labelsManager, + EventsRecorder: eventsRecorder, + Topology: fakeTopologyService, }, }, }, - } - Expect(IsLeaderExists(ep)).To(BeTrue()) + }, + } + + _, err := clusterReconciler.Reconcile(ctx, ctrl.Request{ + NamespacedName: types.NamespacedName{ + Namespace: namespace, + Name: clusterName, + }, }) + Expect(err).NotTo(HaveOccurred(), "an error during reconcile") + + err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: clusterName}, cartridge.Cluster) + Expect(err).NotTo(HaveOccurred()) + + Expect(cartridge.Cluster.Status.Bootstrapped).To(BeFalse(), "cluster unexpectedly bootstrapped") }) - Context("negative cases (leader does not exist)", func() { - It("should return False if leader not assigned", func() { - ep := &corev1.Endpoints{ - ObjectMeta: metav1.ObjectMeta{ - Name: "name", - Namespace: "namespace", - }, - } - Expect(IsLeaderExists(ep)).To(BeFalse()) - }) + It("Must NOT bootstrap cluster if it is already bootstrapped", func() { + cartridge.Bootstrapped() + fakeClient := cartridge.BuildFakeClient() - It("should return False if leader assigned, but IP not exists", func() { - ep := &corev1.Endpoints{ - ObjectMeta: metav1.ObjectMeta{ - Name: "name", - Namespace: "namespace", - Annotations: map[string]string{ - "tarantool.io/leader": "6.6.6.6:8081", - }, - }, - Subsets: []corev1.EndpointSubset{ - { - Addresses: []corev1.EndpointAddress{ - {IP: "0.0.0.0"}, + resourcesManager := &ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: fakeClient, + Scheme: scheme.Scheme, + }, + } + + eventsRecorder := events.NewRecorder(record.NewFakeRecorder(10)) + + clusterReconciler := &ClusterReconciler{ + LabelsManager: labelsManager, + SteppedReconciler: &reconciliation.SteppedReconciler[*ClusterContextCE, *ClusterControllerCE]{ + Client: fakeClient, + Controller: &ClusterControllerCE{ + CommonClusterController: &reconciliation.CommonClusterController{ + CommonController: &reconciliation.CommonController{ + Client: fakeClient, + Schema: scheme.Scheme, + LeaderElection: &election.LeaderElection{ + Client: fakeClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + LabelsManager: labelsManager, + EventsRecorder: eventsRecorder, + Topology: fakeTopologyService, }, }, }, - } - Expect(IsLeaderExists(ep)).To(BeFalse()) + }, + } + + _, err := clusterReconciler.Reconcile(ctx, ctrl.Request{ + NamespacedName: types.NamespacedName{ + Namespace: namespace, + Name: clusterName, + }, }) + Expect(err).NotTo(HaveOccurred(), "an error during reconcile") + + err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: clusterName}, cartridge.Cluster) + Expect(err).NotTo(HaveOccurred()) }) }) }) diff --git a/controllers/replicasettemplate_controller.go b/controllers/replicasettemplate_controller.go deleted file mode 100644 index 51df1c12..00000000 --- a/controllers/replicasettemplate_controller.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package controllers - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" -) - -// ReplicasetTemplateReconciler reconciles a ReplicasetTemplate object -type ReplicasetTemplateReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=tarantool.io,resources=replicasettemplates,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=tarantool.io,resources=replicasettemplates/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=tarantool.io,resources=replicasettemplates/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the ReplicasetTemplate object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile -func (r *ReplicasetTemplateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = log.FromContext(ctx) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *ReplicasetTemplateReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&tarantooliov1alpha1.ReplicasetTemplate{}). - Complete(r) -} diff --git a/controllers/role_controller.go b/controllers/role_controller.go index 40278434..fb4e4c51 100644 --- a/controllers/role_controller.go +++ b/controllers/role_controller.go @@ -1,294 +1,151 @@ -/* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - package controllers import ( "context" - "fmt" - - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" + "github.com/go-logr/logr" "github.com/google/uuid" - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" + . "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal" + "github.com/tarantool/tarantool-operator/internal/implementation" + . "github.com/tarantool/tarantool-operator/internal/steps" + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/common" + "github.com/tarantool/tarantool-operator/pkg/topology" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec" + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec/cli" + appsv1 "k8s.io/api/apps/v1" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" ) -// RoleReconciler reconciles a Role object -type RoleReconciler struct { - client.Client - Scheme *runtime.Scheme -} - //+kubebuilder:rbac:groups=tarantool.io,resources=roles,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=tarantool.io,resources=roles/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=tarantool.io,resources=roles/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Role object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile -func (r *RoleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - reqLogger := log.FromContext(ctx) - reqLogger.Info("Reconciling Role") - - role := &tarantooliov1alpha1.Role{} - err := r.Get(context.TODO(), req.NamespacedName, role) - if err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{}, nil - } - return ctrl.Result{}, err - } - - if len(role.GetOwnerReferences()) == 0 { - return ctrl.Result{}, fmt.Errorf("Orphan role %s", role.GetName()) - } - - templateSelector, err := metav1.LabelSelectorAsSelector(role.Spec.Selector) - if err != nil { - return ctrl.Result{}, err - } - - reqLogger.Info("Got selector", "selector", templateSelector) - - stsSelector := &metav1.LabelSelector{ - MatchLabels: role.GetLabels(), - } - s, err := metav1.LabelSelectorAsSelector(stsSelector) - if err != nil { - return ctrl.Result{}, err - } - - stsList := &appsv1.StatefulSetList{} - if err := r.List(context.TODO(), stsList, &client.ListOptions{LabelSelector: s, Namespace: req.NamespacedName.Namespace}); err != nil { - return ctrl.Result{}, err - } - - // ensure num of statefulsets matches user expectations - if len(stsList.Items) > int(*role.Spec.NumReplicasets) { - reqLogger.Info("Role", "more instances", *role.Spec.NumReplicasets) - for i := len(stsList.Items); i > int(*role.Spec.NumReplicasets); i-- { - sts := &appsv1.StatefulSet{} - sts.Name = fmt.Sprintf("%s-%d", role.Name, i-1) - sts.Namespace = req.Namespace - reqLogger.Info("ROLE DOWNSCALE", "will remove", sts.Name) - - if err := r.Get(context.TODO(), types.NamespacedName{Namespace: sts.Namespace, Name: sts.Name}, sts); err != nil { - if errors.IsNotFound(err) { - continue - } - return ctrl.Result{}, err - } - - stsAnnotations := sts.GetAnnotations() - if stsAnnotations["tarantool.io/scheduledDelete"] == "1" { - reqLogger.Info("statefulset is ready for deletion") - } - // if err := r.client.Delete(context.TODO(), sts); err != nil { - // return reconcile.Result{}, err - // } - } +func NewRoleReconciler(mgr Manager) *RoleReconciler { + k8sConfig := mgr.GetConfig() + k8sClient := mgr.GetClient() + k8sScheme := mgr.GetScheme() + restClient, _ := apiutil.RESTClientForGVK( + schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + false, + k8sConfig, + serializer.NewCodecFactory(k8sScheme), + ) + + labelsManager := &k8s.NamespacedLabelsManager{ + Namespace: "tarantool.io", } - - templateList := &tarantooliov1alpha1.ReplicasetTemplateList{} - if err := r.List(context.TODO(), templateList, &client.ListOptions{LabelSelector: templateSelector, Namespace: req.NamespacedName.Namespace}); err != nil { - return ctrl.Result{}, err + resourcesManager := &implementation.ResourcesManager{ + LabelsManager: labelsManager, + CommonResourcesManager: &k8s.CommonResourcesManager{ + Client: k8sClient, + Scheme: k8sScheme, + }, } - - if len(templateList.Items) == 0 { - return ctrl.Result{}, fmt.Errorf("no template") + eventsRecorder := events.NewRecorder(mgr.GetEventRecorderFor("role-controller")) + luaTopology := &topology.CommonCartridgeTopology{ + Transport: &podexec.PodExec{ + RestClient: restClient, + RestConfig: k8sConfig, + RuntimeScheme: k8sScheme, + CLI: &cli.TarantoolCTL{}, + }, } - template := templateList.Items[0] - - if len(stsList.Items) < int(*role.Spec.NumReplicasets) { - for i := 0; i < int(*role.Spec.NumReplicasets); i++ { - sts := &appsv1.StatefulSet{} - sts.Name = fmt.Sprintf("%s-%d", role.Name, i) - sts.Namespace = req.Namespace - - if err := r.Get(context.TODO(), types.NamespacedName{Namespace: sts.Namespace, Name: sts.Name}, sts); err != nil { - sts = CreateStatefulSetFromTemplate(ctx, i, fmt.Sprintf("%s-%d", role.Name, i), role, &template) - if err := controllerutil.SetControllerReference(role, sts, r.Scheme); err != nil { - return ctrl.Result{}, err - } - if err := r.Create(context.TODO(), sts); err != nil { - return ctrl.Result{}, err - } - } - } + return &RoleReconciler{ + SteppedReconciler: &SteppedReconciler[*RoleContextCE, *RoleControllerCE]{ + Client: k8sClient, + Controller: &RoleControllerCE{ + ReplicasetsManger: &implementation.ReplicasetsManger{ + ResourcesManager: resourcesManager, + // UUIDSpace is a randomly generate uuid v4 used as base for generation v5 uuid of replicasets. + UUIDSpace: uuid.MustParse("8601615b-c39f-4fd9-a88b-9df688656cbd"), + }, + CommonRoleController: &CommonRoleController{ + CommonController: &CommonController{ + Client: k8sClient, + Schema: k8sScheme, + LeaderElection: &election.LeaderElection{ + Client: k8sClient, + Recorder: eventsRecorder, + ResourcesManager: resourcesManager, + }, + ResourcesManager: resourcesManager, + EventsRecorder: eventsRecorder, + Topology: luaTopology, + LabelsManager: labelsManager, + }, + }, + }, + }, } +} - for _, sts := range stsList.Items { - if template.Spec.Replicas != sts.Spec.Replicas { - reqLogger.Info("Updating replicas count") - sts.Spec.Replicas = template.Spec.Replicas - if err := r.Update(context.TODO(), &sts); err != nil { - return ctrl.Result{}, err - } - } - - if template.Spec.Template.Spec.Containers[0].Image != sts.Spec.Template.Spec.Containers[0].Image { - reqLogger.Info("Updating container image") - sts.Spec.Template.Spec.Containers[0].Image = template.Spec.Template.Spec.Containers[0].Image - if err := r.Update(context.TODO(), &sts); err != nil { - return ctrl.Result{}, err - } - } - - sts.Spec.Template.Spec.Containers[0].Env = template.Spec.Template.Spec.Containers[0].Env - reqLogger.Info("Env variables", "vars", sts.Spec.Template.Spec.Containers[0].Env) - if err := r.Update(context.TODO(), &sts); err != nil { - return ctrl.Result{}, err - } - - if templateRolesToAssign, ok := template.ObjectMeta.Annotations["tarantool.io/rolesToAssign"]; ok { - // check rolesToAssign from annotations - if templateRolesToAssign != sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] { - reqLogger.Info("Updating replicaset rolesToAssign", - "from", sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"], - "to", templateRolesToAssign) - - sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] = templateRolesToAssign - sts.Spec.Template.Annotations["tarantool.io/rolesToAssign"] = templateRolesToAssign - - if err := r.Update(context.TODO(), &sts); err != nil { - return ctrl.Result{}, err - } - } - } else { - // check rolesToAssign from labels (deprecated) - templateRolesToAssignFromLabels, ok := template.ObjectMeta.Labels["tarantool.io/rolesToAssign"] - if ok && templateRolesToAssignFromLabels != sts.ObjectMeta.Labels["tarantool.io/rolesToAssign"] { - reqLogger.Info("Updating replicaset rolesToAssign from labels", - "from", sts.ObjectMeta.Labels["tarantool.io/rolesToAssign"], - "to", templateRolesToAssignFromLabels) - - sts.ObjectMeta.Labels["tarantool.io/rolesToAssign"] = templateRolesToAssignFromLabels - sts.Spec.Template.Labels["tarantool.io/rolesToAssign"] = templateRolesToAssignFromLabels - - if err := r.Update(context.TODO(), &sts); err != nil { - return ctrl.Result{}, err - } - } - } - } +// RoleReconciler reconciles a Role object. +type RoleReconciler struct { + *SteppedReconciler[*RoleContextCE, *RoleControllerCE] +} - return ctrl.Result{}, nil +func (r *RoleReconciler) Reconcile(ctx context.Context, req Request) (Result, error) { + return r.Run( + &RoleContextCE{ + CommonContext: &CommonContext{ + Context: ctx, + Request: req, + Logger: logr.FromContextOrDiscard(ctx), + }, + }, + Info[*RoleContextCE, *RoleControllerCE]("Reconcile role"), + GetRequestedObject[*RoleContextCE, *RoleControllerCE](&Role{}), + ResetRoleStatus(), + + SetRolePhase(RoleWaitingForCluster), + GetClusterByLabels[*RoleContextCE, *RoleControllerCE](), + + SetRolePhase(RolePending), + CreateStatefulSets(), + UpdateStatefulSets(), + + SetRolePhase(RoleWaitingForLeader), + GetLeader[*RoleContextCE, *RoleControllerCE](), + + SetRolePhase(RoleWaitForCartridgeReady), + EnsureCartridgeReady(), + + SetRolePhase(RoleJoining), + JoinInstances(JoinInstancesParams{ + ConfigErrorPhase: RoleConfigError, + }), + + SetRolePhase(RoleConfiguring), + ConfigureVShardRoles(), + + SetRolePhase(RoleWaitingForBootstrap), + WaitForClusterBootstrapped[*RoleContextCE, *RoleControllerCE](), + + SetRolePhase(RoleConfiguringWeights), + SetVShardWeights(), + + SetRolePhase(RoleReady), + Info[*RoleContextCE, *RoleControllerCE]("Role ready"), + ) } // SetupWithManager sets up the controller with the Manager. -func (r *RoleReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&tarantooliov1alpha1.Role{}). - Watches(&source.Kind{Type: &tarantooliov1alpha1.Role{}}, &handler.EnqueueRequestForObject{}). - Watches(&source.Kind{Type: &appsv1.StatefulSet{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &tarantooliov1alpha1.Role{}, - }). - Watches(&source.Kind{Type: &tarantooliov1alpha1.ReplicasetTemplate{}}, handler.EnqueueRequestsFromMapFunc(func(a client.Object) []reconcile.Request { - roleList := &tarantooliov1alpha1.RoleList{} - if err := r.Client.List(context.TODO(), roleList, &client.ListOptions{}); err != nil { - mgr.GetLogger().Info("FUCK") - } - - res := []reconcile.Request{} - for _, role := range roleList.Items { - res = append(res, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Name: role.GetName(), - Namespace: role.GetNamespace(), - }, - }) - } - return res - })). +func (r *RoleReconciler) SetupWithManager(mgr Manager) error { + return NewControllerManagedBy(mgr). + For(&Role{}). + Owns(&appsv1.StatefulSet{}). + Owns(&v1.Pod{}). Complete(r) } - -// CreateStatefulSetFromTemplate . -func CreateStatefulSetFromTemplate(ctx context.Context, replicasetNumber int, name string, role *tarantooliov1alpha1.Role, rs *tarantooliov1alpha1.ReplicasetTemplate) *appsv1.StatefulSet { - reqLogger := log.FromContext(ctx) - - reqLogger.Info("RST", "IS:", *rs) - sts := &appsv1.StatefulSet{ - Spec: *rs.Spec, - } - reqLogger.Info("STS", "IS:", *sts) - - sts.Name = name - sts.Namespace = role.GetNamespace() - sts.ObjectMeta.Labels = role.GetLabels() - - sts.Spec.UpdateStrategy = appsv1.StatefulSetUpdateStrategy{Type: "OnDelete"} - - for k, v := range role.GetLabels() { - sts.Spec.Template.Labels[k] = v - } - - privileged := false - - sts.Spec.Template.Spec.Containers[0].SecurityContext = &corev1.SecurityContext{ - Privileged: &privileged, - } - - sts.Spec.ServiceName = role.GetAnnotations()["tarantool.io/cluster-id"] - replicasetUUID := uuid.NewSHA1(space, []byte(sts.GetName())) - sts.ObjectMeta.Labels["tarantool.io/replicaset-uuid"] = replicasetUUID.String() - sts.ObjectMeta.Labels["tarantool.io/vshardGroupName"] = role.GetLabels()["tarantool.io/role"] - - if sts.ObjectMeta.Annotations == nil { - sts.ObjectMeta.Annotations = make(map[string]string) - } - - sts.ObjectMeta.Annotations["tarantool.io/isBootstrapped"] = "0" - sts.ObjectMeta.Annotations["tarantool.io/replicaset-weight"] = "100" - - sts.Spec.Template.Labels["tarantool.io/replicaset-uuid"] = replicasetUUID.String() - sts.Spec.Template.Labels["tarantool.io/vshardGroupName"] = role.GetLabels()["tarantool.io/role"] - - return sts -} diff --git a/controllers/role_controller_test.go b/controllers/role_controller_test.go deleted file mode 100644 index 9d4f1233..00000000 --- a/controllers/role_controller_test.go +++ /dev/null @@ -1,294 +0,0 @@ -package controllers - -import ( - "context" - "fmt" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - helpers "github.com/tarantool/tarantool-operator/test/helpers" - - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" - - "sigs.k8s.io/controller-runtime/pkg/client" -) - -var _ = Describe("role_controller unit testing", func() { - var ( - namespace = "default" - ctx = context.TODO() - - roleName = "" // setup for every spec in hook - rsTemplateName = "" - stsName = "" - - clusterId = "t" - - defaultRolesToAssign = "[\"A\",\"B\"]" - newRolesToAssign = "[\"A\",\"B\",\"C\"]" - ) - - BeforeEach(func() { - // setup variables for each spec - roleName = fmt.Sprintf("test-role-%s", RandStringRunes(4)) - rsTemplateName = fmt.Sprintf("test-rs-%s", RandStringRunes(4)) - stsName = fmt.Sprintf("%s-%d", roleName, 0) - - By("create new Role " + roleName) - role := helpers.NewRole(helpers.RoleParams{ - Name: roleName, - Namespace: namespace, - RolesToAssign: defaultRolesToAssign, - RsNum: int32(1), - RsTemplateName: rsTemplateName, - ClusterId: clusterId, - }) - // mock owner reference - role.SetOwnerReferences([]metav1.OwnerReference{ - { - APIVersion: "v0", - Kind: "mockRef", - Name: "mockRef", - UID: "-", - }, - }) - Expect(k8sClient.Create(ctx, &role)).NotTo(HaveOccurred(), "failed to create Role") - - By("create new ReplicasetTemplate " + rsTemplateName) - rsTemplate := helpers.NewReplicasetTemplate(helpers.ReplicasetTemplateParams{ - Name: rsTemplateName, - Namespace: namespace, - RoleName: roleName, - RolesToAssign: defaultRolesToAssign, - }) - Expect(k8sClient.Create(ctx, &rsTemplate)).NotTo(HaveOccurred(), "failed to create ReplicasetTemplate") - }) - - AfterEach(func() { - By("remove role object " + roleName) - role := &tarantooliov1alpha1.Role{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: roleName, Namespace: namespace}, role), - ).NotTo(HaveOccurred(), "failed to get Role") - - Expect(k8sClient.Delete(ctx, role)).NotTo(HaveOccurred(), "failed to delete Role") - - By("remove ReplicasetTemplate object " + rsTemplateName) - rsTemplate := &tarantooliov1alpha1.ReplicasetTemplate{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: rsTemplateName, Namespace: namespace}, rsTemplate), - ) - - Expect(k8sClient.Delete(ctx, rsTemplate)).NotTo(HaveOccurred(), "failed to delete Role") - }) - - Describe("role_controller should react to the sts-template change and update the sts", func() { - Context("update rolesToAssign annotation in sts-template", func() { - It("set rolesToAssign by creating sts", func() { - By("get sts") - sts := &appsv1.StatefulSet{} - Eventually( - func() bool { - if k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) != nil { - return false - } - if sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] == "" || - sts.Spec.Template.Annotations["tarantool.io/rolesToAssign"] == "" { - return false - } - return true - }, - time.Second*10, time.Millisecond*500, - ).Should(BeTrue()) - - By("check roleToAssign in sts") - Expect(sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"]).To(Equal(defaultRolesToAssign)) - Expect(sts.Spec.Template.Annotations["tarantool.io/rolesToAssign"]).To(Equal(defaultRolesToAssign)) - }) - - It("set roleToAssign by updating sts-template", func() { - By("update rolesToAssign annotations in ReplicasetTemplate") - rsTemplate := &tarantooliov1alpha1.ReplicasetTemplate{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: rsTemplateName, Namespace: namespace}, rsTemplate), - ).NotTo(HaveOccurred(), "failed to get ReplicasetTemplate") - - rsTemplate.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] = newRolesToAssign - rsTemplate.Spec.Template.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] = newRolesToAssign - Expect( - k8sClient.Update(ctx, rsTemplate), - ).NotTo(HaveOccurred(), "failed to update ReplicasetTemplate") - - By("update rolesToAssign annotation in Role") - role := &tarantooliov1alpha1.Role{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: roleName, Namespace: namespace}, role), - ).NotTo(HaveOccurred(), "failed to get Role") - - role.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] = newRolesToAssign - Expect( - k8sClient.Update(ctx, role), - ).NotTo(HaveOccurred(), "failed to update Role") - - By("check roleToAssign in sts") - sts := &appsv1.StatefulSet{} - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) - if err != nil { - return false - } - - if sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] == newRolesToAssign && - sts.Spec.Template.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] == newRolesToAssign { - return true - } - - return false - }, - time.Second*10, time.Millisecond*500, - ).Should(BeTrue()) - }) - }) - - Context("update env variables in container template", func() { - It("update existed variable", func() { - By("update MEMTX_MEMORY value in ReplicasetTemplate") - var ( - value = "300000" - ) - - rsTemplate := &tarantooliov1alpha1.ReplicasetTemplate{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: rsTemplateName, Namespace: namespace}, rsTemplate), - ).NotTo(HaveOccurred(), "failed to get ReplicasetTemplate") - - vars := rsTemplate.Spec.Template.Spec.Containers[0].Env - for i := range vars { - if vars[i].Name == "TARANTOOL_MEMTX_MEMORY" { - vars[i].Value = value - break - } - } - - Expect( - k8sClient.Update(ctx, rsTemplate), - ).NotTo(HaveOccurred(), "failed to update ReplicasetTemplate") - - By("check that the TARANTOOL_MEMTX_MEMORY in sts") - sts := &appsv1.StatefulSet{} - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) - if err != nil { - return false - } - - for _, env := range sts.Spec.Template.Spec.Containers[0].Env { - if env.Name == "TARANTOOL_MEMTX_MEMORY" && env.Value == value { - return true - } - } - - return false - }, - time.Second*10, time.Millisecond*500, - ).Should(BeTrue()) - }) - - It("add new variable", func() { - By("add new env variable in ReplicasetTemplate") - var ( - newVarName = "NEW_NAME" - newVarValue = "NEW_VALUE" - ) - - rsTemplate := &tarantooliov1alpha1.ReplicasetTemplate{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: rsTemplateName, Namespace: namespace}, rsTemplate), - ).NotTo(HaveOccurred(), "failed to get ReplicasetTemplate") - - rsTemplate.Spec.Template.Spec.Containers[0].Env = append( - rsTemplate.Spec.Template.Spec.Containers[0].Env, - corev1.EnvVar{Name: newVarName, Value: newVarValue}, - ) - - Expect( - k8sClient.Update(ctx, rsTemplate), - ).NotTo(HaveOccurred(), "failed to update ReplicasetTemplate") - - By("check that the new env variable in sts") - sts := &appsv1.StatefulSet{} - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) - if err != nil { - return false - } - - for _, env := range sts.Spec.Template.Spec.Containers[0].Env { - if env.Name == newVarName && env.Value == newVarValue { - return true - } - } - - return false - }, - time.Second*10, time.Millisecond*500, - ).Should(BeTrue()) - }) - - It("unset variable", func() { - var ( - varName = "TARANTOOL_WORKDIR" - ) - rsTemplate := &tarantooliov1alpha1.ReplicasetTemplate{} - Expect( - k8sClient.Get(ctx, client.ObjectKey{Name: rsTemplateName, Namespace: namespace}, rsTemplate), - ).NotTo(HaveOccurred(), "failed to get ReplicasetTemplate") - - removeFromSlice := func(s []corev1.EnvVar, i int) []corev1.EnvVar { - return append(s[:i], s[i+1:]...) - } - - for i, v := range rsTemplate.Spec.Template.Spec.Containers[0].Env { - if v.Name == varName { - rsTemplate.Spec.Template.Spec.Containers[0].Env = removeFromSlice( - rsTemplate.Spec.Template.Spec.Containers[0].Env, i) - break - } - } - - Expect( - k8sClient.Update(ctx, rsTemplate), - ).NotTo(HaveOccurred(), "failed to update ReplicasetTemplate") - - By("check that the old env variable is not in sts") - sts := &appsv1.StatefulSet{} - Eventually( - func() bool { - err := k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) - if err != nil { - return false - } - - for _, env := range sts.Spec.Template.Spec.Containers[0].Env { - if env.Name == varName { - return false - } - } - - return true - }, - time.Second*10, time.Millisecond*500, - ).Should(BeTrue()) - }) - }) - }) -}) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index aaeaf284..3434e36b 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -1,124 +1,40 @@ -/* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package controllers +package controllers_test import ( "context" - "path/filepath" "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/tarantool/tarantool-operator/apis/v1beta1" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" - //+kubebuilder:scaffold:imports ) -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - var ( - cfg *rest.Config - k8sClient client.Client - testEnv *envtest.Environment - ctx context.Context - cancel context.CancelFunc + ctx context.Context + cancel context.CancelFunc ) -func TestAPIs(t *testing.T) { +func TestControllers(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Controller Suite") + RunSpecs(t, "Controllers Suite") } var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - ctx, cancel = context.WithCancel(context.TODO()) - - By("bootstrapping test environment") - useExistingCluster := true - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, - ErrorIfCRDPathMissing: true, - UseExistingCluster: &useExistingCluster, - } - var err error - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) + + logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) + ctx, cancel = context.WithCancel(context.Background()) err = scheme.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) - err = tarantooliov1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) + err = v1beta1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) - Expect(k8sClient).NotTo(BeNil()) - - mgr, err := ctrl.NewManager(cfg, ctrl.Options{}) - Expect(err).NotTo(HaveOccurred(), "failed to create manager") - - clusterReconciler := &ClusterReconciler{ - Client: mgr.GetClient(), - Scheme: scheme.Scheme, - } - err = clusterReconciler.SetupWithManager(mgr) - Expect(err).ToNot(HaveOccurred()) - - err = (&RoleReconciler{ - Client: mgr.GetClient(), - Scheme: scheme.Scheme, - }).SetupWithManager(mgr) - Expect(err).ToNot(HaveOccurred()) - - go func() { - err = mgr.Start(ctx) - Expect(err).ToNot(HaveOccurred()) - }() - }, 60) var _ = AfterSuite(func() { - By("tearing down the test environment") cancel() - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) }) diff --git a/controllers/tarantool/instance.go b/controllers/tarantool/instance.go deleted file mode 100644 index 2bdbd482..00000000 --- a/controllers/tarantool/instance.go +++ /dev/null @@ -1,90 +0,0 @@ -package tarantool - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/selection" -) - -const ( - instanceJoined = "joined" - instanceExpelling = "expelling" -) - -// IsJoined . -func IsJoined(p *corev1.Pod) bool { - podLabels := p.GetLabels() - if podLabels == nil { - return false - } - v, ok := podLabels["tarantool.io/instance-state"] - if !ok { - return false - } - if v != instanceJoined { - return false - } - - return true -} - -// MarkJoined . -func MarkJoined(p *corev1.Pod) { - podLabels := p.GetLabels() - if podLabels == nil { - podLabels = make(map[string]string) - } - podLabels["tarantool.io/instance-state"] = instanceJoined - p.SetLabels(podLabels) -} - -// JoinedSelector . -func JoinedSelector() (labels.Selector, error) { - s := labels.NewSelector() - r, err := labels.NewRequirement("tarantool.io/instance-state", selection.Equals, []string{instanceJoined}) - if err != nil { - return nil, err - } - s.Add(*r) - - return s, nil -} - -// IsExpelling . -func IsExpelling(p *corev1.Pod) bool { - podLabels := p.GetLabels() - if podLabels == nil { - return false - } - v, ok := podLabels["tarantool.io/instance-state"] - if !ok { - return false - } - if v != instanceExpelling { - return false - } - - return true -} - -// MarkExpelling . -func MarkExpelling(p *corev1.Pod) { - podLabels := p.GetLabels() - if podLabels == nil { - podLabels = make(map[string]string) - } - podLabels["tarantool.io/instance-state"] = instanceExpelling - p.SetLabels(podLabels) -} - -// ExpellingSelector . -func ExpellingSelector() (labels.Selector, error) { - s := labels.NewSelector() - r, err := labels.NewRequirement("tarantool.io/instance-state", selection.Equals, []string{instanceExpelling}) - if err != nil { - return nil, err - } - s.Add(*r) - - return s, nil -} diff --git a/controllers/tarantool/replicaset.go b/controllers/tarantool/replicaset.go deleted file mode 100644 index aaf8cc72..00000000 --- a/controllers/tarantool/replicaset.go +++ /dev/null @@ -1 +0,0 @@ -package tarantool diff --git a/controllers/tarantool/utils/utils.go b/controllers/tarantool/utils/utils.go deleted file mode 100644 index f5c638c5..00000000 --- a/controllers/tarantool/utils/utils.go +++ /dev/null @@ -1,41 +0,0 @@ -package utils - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// SetComponent . -func SetComponent(o metav1.Object, componentName string) error { - labels := o.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - labels["app.kubernetes.io/component"] = componentName - o.SetLabels(labels) - - return nil -} - -// SetPartOf . -func SetPartOf(o metav1.Object, appName string) error { - labels := o.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - labels["app.kubernetes.io/part-of"] = appName - o.SetLabels(labels) - - return nil -} - -// SetTarantoolClusterID . -func SetTarantoolClusterID(o metav1.Object, clusteID string) error { - labels := o.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - labels["tarantool.io/cluster-id"] = clusteID - o.SetLabels(labels) - - return nil -} diff --git a/controllers/topology/builtin.go b/controllers/topology/builtin.go deleted file mode 100644 index 69676a72..00000000 --- a/controllers/topology/builtin.go +++ /dev/null @@ -1,481 +0,0 @@ -package topology - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strconv" - "strings" - "time" - - "github.com/machinebox/graphql" - corev1 "k8s.io/api/core/v1" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// ResponseError . -type ResponseError struct { - Message string `json:"message"` -} - -// JoinResponseData . -type JoinResponseData struct { - JoinInstance bool `json:"joinInstanceResponse"` -} - -// JoinResponse . -type JoinResponse struct { - Errors []*ResponseError `json:"errors,omitempty"` - Data *JoinResponseData `json:"data,omitempty"` -} - -// ExpelResponseData . -type ExpelResponseData struct { - ExpelInstance bool `json:"expel_instance"` -} - -// ExpelResponse . -type ExpelResponse struct { - Errors []*ResponseError `json:"errors,omitempty"` - Data *ExpelResponseData `json:"data,omitempty"` -} - -// BootstrapVshardData . -type BootstrapVshardData struct { - BootstrapVshard bool `json:"bootstrapVshardResponse"` -} - -// BootstrapVshardResponse . -type BootstrapVshardResponse struct { - Data *BootstrapVshardData `json:"data,omitempty"` - Errors []*ResponseError `json:"errors,omitempty"` -} - -// FailoverData Structure of data for changing failover status -type FailoverData struct { -} - -// FailoverResponse type struct for returning on failovers -type FailoverResponse struct { - Data *FailoverData - Errors []*ResponseError -} - -// BuiltInTopologyService . -type BuiltInTopologyService struct { - serviceHost string - clusterID string -} - -// EditReplicasetResponse . -type EditReplicasetResponse struct { - Response bool `json:"editReplicasetResponse"` -} - -// GetServerStatResponse . -type GetServerStatResponse struct { - Data *ServerStatData `json:"data"` - Errors []*ResponseError `json:"errors,omitempty"` -} - -// ServerStatData . -type ServerStatData struct { - Stats []*ServerStat `json:"serverStat"` -} - -// ServerStat . -type ServerStat struct { - Statistics Statistics `json:"statistics"` - UUID string `json:"uuid"` - URI string `json:"uri"` -} - -// ReplicasetsQueryResponse struct for returning replicasets data -type ReplicasetsQueryResponse struct { - Replicasets []*ReplicasetData `json:"replicasets"` -} - -// ReplicasetData . -type ReplicasetData struct { - UUID string `json:"uuid"` - Roles []string `json:"roles"` -} - -// Statistics . -type Statistics struct { - ItemsUsedRatio string `json:"items_used_ratio"` - ArenaUsedRatio string `json:"arena_used_ratio"` - QuotaSize int `json:"quotaSize"` - ArenaUsed int `json:"arenaUsed"` - QuotaUsedRatio string `json:"quota_used_ratio"` - BucketsCount int `json:"bucketsCount"` -} - -var log = logf.Log.WithName("topology") - -var ( - errTopologyIsDown = errors.New("topology service is down") - errAlreadyJoined = errors.New("already joined") - errAlreadyBootstrapped = errors.New("already bootstrapped") -) - -var joinMutation = `mutation - do_join_server( - $uri: String!, - $instance_uuid: String!, - $replicaset_uuid: String!, - $roles: [String!], - $vshard_group: String! - ) { - joinInstanceResponse: join_server( - uri: $uri, - instance_uuid: $instance_uuid, - replicaset_uuid: $replicaset_uuid, - roles: $roles, - timeout: 10, - vshard_group: $vshard_group - ) -}` - -var setRsWeightMutation = `mutation editReplicaset($uuid: String!, $weight: Float) { - editReplicasetResponse: edit_replicaset(uuid: $uuid, weight: $weight) -}` - -var setRsRolesMutation = `mutation editReplicaset($uuid: String!, $roles: [String!]) { - editReplicasetResponse: edit_replicaset(uuid: $uuid, roles: $roles) -}` - -var getRsRolesQuery = `query ($uuid: String!) { - replicasets(uuid: $uuid) { roles } -}` - -var getServerStatQuery = `query serverList { - serverStat: servers { - uuid - uri - statistics { - quotaSize: quota_size - arenaUsed: arena_used - bucketsCount: vshard_buckets_count - quota_used_ratio - arena_used_ratio - items_used_ratio - } - } -}` - -// An interface describing an object with accessor methods for labels and annotations -type ObjectWithMeta interface { - GetLabels() map[string]string - GetAnnotations() map[string]string -} - -// GetRoles comment -func GetRoles(obj ObjectWithMeta) ([]string, error) { - labels := obj.GetLabels() - annotations := obj.GetAnnotations() - - rolesFromAnnotations, ok := annotations["tarantool.io/rolesToAssign"] - if !ok { - rolesFromLabels, ok := labels["tarantool.io/rolesToAssign"] - if !ok { - return nil, errors.New("role undefined") - } - - roles := strings.Split(rolesFromLabels, ".") - log.Info("roles", "roles", roles) - - return roles, nil - } - - var singleRole string - var roleArray []string - - err := json.Unmarshal([]byte(rolesFromAnnotations), &singleRole) - if err == nil { - log.Info("roles", "roles", singleRole) - return []string{singleRole}, nil - } - - err = json.Unmarshal([]byte(rolesFromAnnotations), &roleArray) - if err == nil { - log.Info("roles", "roles", roleArray) - return roleArray, nil - } - - return nil, errors.New("failed to parse roles from annotations") -} - -// Join comment -func (s *BuiltInTopologyService) Join(pod *corev1.Pod) error { - - thisPodLabels := pod.GetLabels() - clusterDomainName, ok := thisPodLabels["tarantool.io/cluster-domain-name"] - if !ok { - clusterDomainName = "cluster.local" - } - - advURI := fmt.Sprintf("%s.%s.%s.svc.%s:3301", - pod.GetObjectMeta().GetName(), // Instance name - s.clusterID, // Cartridge cluster name - pod.GetObjectMeta().GetNamespace(), // Namespace - clusterDomainName) // Cluster domain name - - replicasetUUID, ok := thisPodLabels["tarantool.io/replicaset-uuid"] - if !ok { - return errors.New("replicaset uuid empty") - } - - log.Info("payload", "advURI", advURI, "replicasetUUID", replicasetUUID) - - instanceUUID, ok := thisPodLabels["tarantool.io/instance-uuid"] - if !ok { - return errors.New("instance uuid empty") - } - - roles, err := GetRoles(pod) - if err != nil { - return err - } - log.Info("roles", "roles", roles) - - vshardGroup := "default" - useVshardGroups, ok := thisPodLabels["tarantool.io/useVshardGroups"] - if !ok { - return errors.New("failed to get label tarantool.io/useVshardGroups") - } - - if useVshardGroups == "1" { - vshardGroup, ok = thisPodLabels["tarantool.io/vshardGroupName"] - if !ok { - return errors.New("vshard_group undefined") - } - } - - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - req := graphql.NewRequest(joinMutation) - - req.Var("uri", advURI) - req.Var("instance_uuid", instanceUUID) - req.Var("replicaset_uuid", replicasetUUID) - req.Var("roles", roles) - req.Var("vshard_group", vshardGroup) - - resp := &JoinResponseData{} - if err := client.Run(context.TODO(), req, resp); err != nil { - if strings.Contains(err.Error(), "already joined") { - return errAlreadyJoined - } - if strings.Contains(err.Error(), "This instance isn't bootstrapped yet") { - return errTopologyIsDown - } - - return err - } - - if resp.JoinInstance { - return nil - } - - return errors.New("something really bad happened") -} - -// SetFailover enables cluster failover -func (s *BuiltInTopologyService) SetFailover(enabled bool) error { - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - req := graphql.NewRequest(`mutation changeFailover($enabled: Boolean!) { cluster { failover(enabled: $enabled) }}`) - - req.Var("enabled", enabled) - - resp := &FailoverData{} - if err := client.Run(context.TODO(), req, resp); err != nil { - log.Error(err, "failoverError") - return errors.New("failed to enable cluster failover") - } - - return nil -} - -// Expel removes an instance from the replicaset -func (s *BuiltInTopologyService) Expel(pod *corev1.Pod) error { - req := fmt.Sprintf("mutation {expel_instance:expel_server(uuid:\\\"%s\\\")}", pod.GetAnnotations()["tarantool.io/instance_uuid"]) - j := fmt.Sprintf("{\"query\": \"%s\"}", req) - rawResp, err := http.Post(s.serviceHost, "application/json", strings.NewReader(j)) - if err != nil { - return err - } - defer rawResp.Body.Close() - - resp := &ExpelResponse{Errors: []*ResponseError{}, Data: &ExpelResponseData{}} - if err := json.NewDecoder(rawResp.Body).Decode(resp); err != nil { - return err - } - - if !resp.Data.ExpelInstance && (resp.Errors == nil || len(resp.Errors) == 0) { - return errors.New("something really bad happened") - } - - return nil -} - -// SetWeight sets weight of a replicaset -func (s *BuiltInTopologyService) SetWeight(replicasetUUID string, replicaWeight string) error { - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - req := graphql.NewRequest(setRsWeightMutation) - - reqLogger := log.WithValues("namespace", "topology.builtin") - - weightParam, err := strconv.ParseUint(replicaWeight, 10, 32) - if err != nil { - return err - } - - reqLogger.Info("setting cluster weight", "uuid", replicasetUUID, "weight", replicaWeight) - - req.Var("uuid", replicasetUUID) - req.Var("weight", weightParam) - - resp := &EditReplicasetResponse{} - if err := client.Run(context.TODO(), req, resp); err != nil { - return err - } - - if resp.Response { - return nil - } - - return errors.New("something really bad happened") -} - -// SetReplicasetRoles set roles list of replicaset in the Tarantool service -func (s *BuiltInTopologyService) SetReplicasetRoles(replicasetUUID string, roles []string) error { - reqLogger := log.WithValues("namespace", "topology.builtin") - reqLogger.Info("setting replicaset roles", "uuid", replicasetUUID, "weight", roles) - - req := graphql.NewRequest(setRsRolesMutation) - req.Var("uuid", replicasetUUID) - req.Var("roles", roles) - - resp := &EditReplicasetResponse{} - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - - if err := client.Run(context.TODO(), req, resp); err != nil { - return err - } - return nil -} - -// GetReplicasetRolesFromService get roles list of replicaset from the Tarantool service -func (s *BuiltInTopologyService) GetReplicasetRolesFromService(replicasetUUID string) ([]string, error) { - reqLogger := log.WithValues("namespace", "topology.builtin") - reqLogger.Info("getting replicaset roles", "uuid", replicasetUUID) - - req := graphql.NewRequest(getRsRolesQuery) - req.Var("uuid", replicasetUUID) - - resp := &ReplicasetsQueryResponse{} - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - if err := client.Run(context.TODO(), req, resp); err != nil { - return nil, err - } - - if len(resp.Replicasets) == 0 { - return nil, fmt.Errorf("replicaset with uuid: '%s' not found", replicasetUUID) - } - return resp.Replicasets[0].Roles, nil -} - -// GetServerStat Fetch the replicaset as reported by cartridge -func (s *BuiltInTopologyService) GetServerStat() (ServerStatData, error) { - client := graphql.NewClient(s.serviceHost, graphql.WithHTTPClient(&http.Client{Timeout: time.Duration(time.Second * 5)})) - req := graphql.NewRequest(getServerStatQuery) - - reqLogger := log.WithValues("function", "GetServerStat") - - reqLogger.Info("fetching server stats") - - resp := ServerStatData{} - if err := client.Run(context.TODO(), req, &resp); err != nil { - return resp, err - } - - return resp, nil -} - -// BootstrapVshard enable the vshard service on the cluster -func (s *BuiltInTopologyService) BootstrapVshard() error { - reqLogger := log.WithValues("namespace", "topology.builtin") - - reqLogger.Info("Bootstrapping vshard") - - req := "mutation bootstrap {bootstrapVshardResponse: bootstrap_vshard}" - j := fmt.Sprintf("{\"query\": \"%s\"}", req) - rawResp, err := http.Post(s.serviceHost, "application/json", strings.NewReader(j)) - if err != nil { - return err - } - - defer rawResp.Body.Close() - - resp := &BootstrapVshardResponse{Data: &BootstrapVshardData{}} - if err := json.NewDecoder(rawResp.Body).Decode(resp); err != nil { - return err - } - - if resp.Data.BootstrapVshard { - return nil - } - if resp.Errors != nil && len(resp.Errors) > 0 { - if strings.Contains(resp.Errors[0].Message, "already bootstrapped") { - return errAlreadyBootstrapped - } - - return errors.New(resp.Errors[0].Message) - } - - return errors.New("unknown error") -} - -// IsTopologyDown . -func IsTopologyDown(err error) bool { - return err == errTopologyIsDown -} - -// IsAlreadyJoined . -func IsAlreadyJoined(err error) bool { - return err == errAlreadyJoined -} - -// IsAlreadyBootstrapped . -func IsAlreadyBootstrapped(err error) bool { - return err == errAlreadyBootstrapped -} - -// Option . -type Option func(s *BuiltInTopologyService) - -// WithTopologyEndpoint . -func WithTopologyEndpoint(url string) Option { - return func(s *BuiltInTopologyService) { - s.serviceHost = url - } -} - -// WithClusterID . -func WithClusterID(id string) Option { - return func(s *BuiltInTopologyService) { - s.clusterID = id - } -} - -// NewBuiltInTopologyService . -func NewBuiltInTopologyService(opts ...Option) *BuiltInTopologyService { - s := &BuiltInTopologyService{} - for _, opt := range opts { - opt(s) - } - - return s -} diff --git a/controllers/topology/builtin_test.go b/controllers/topology/builtin_test.go deleted file mode 100644 index da8f60fd..00000000 --- a/controllers/topology/builtin_test.go +++ /dev/null @@ -1,151 +0,0 @@ -package topology - -import ( - "strings" - "testing" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func Contains(a []string, x string) bool { - for _, n := range a { - if x == n { - return true - } - } - return false -} - -type errorTestCase struct { - pod *corev1.Pod - expectedErr string -} - -func TestGetRoles_ErrorCases(t *testing.T) { - cases := []errorTestCase{ - { - pod: &corev1.Pod{}, - expectedErr: "role undefined", - }, - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{}, - }, - }, - expectedErr: "role undefined", - }, - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "tarantool.io/someLabel": "some value", - }, - }, - }, - expectedErr: "role undefined", - }, - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{}, - Labels: map[string]string{}, - }, - }, - expectedErr: "role undefined", - }, - } - for i, c := range cases { - roles, err := GetRoles(c.pod) - - if roles != nil { - t.Fatalf("%d: roles must be nil", i) - } - - if strings.Contains(err.Error(), c.expectedErr) == false { - t.Fatalf("%d: expected error %s, got %s", i, c.expectedErr, err.Error()) - } - } -} - -type parseRolesTestCase struct { - pod *corev1.Pod - expectedRoles []string -} - -func TestGetRoles_ParsesRolesFromLabels(t *testing.T) { - cases := []parseRolesTestCase{ - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "tarantool.io/rolesToAssign": "router", - }, - }, - }, - expectedRoles: []string{"router"}, - }, - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "tarantool.io/rolesToAssign": "router.storage", - }, - }, - }, - expectedRoles: []string{"router", "storage"}, - }, - } - - for i, c := range cases { - roles, _ := GetRoles(c.pod) - if len(roles) != len(c.expectedRoles) { - t.Fatalf("%d: expected %d roles, got %d", i, len(c.expectedRoles), len(roles)) - } - - for _, v := range c.expectedRoles { - if Contains(roles, v) == false { - t.Fatalf("%d: roles must contain %s", i, v) - } - } - } -} - -func TestGetRoles_ParseRolesFromAnnotations(t *testing.T) { - cases := []parseRolesTestCase{ - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "tarantool.io/rolesToAssign": `"router"`, - }, - }, - }, - expectedRoles: []string{"router"}, - }, - { - pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "tarantool.io/rolesToAssign": `["router", "vshard.storage"]`, - }, - }, - }, - expectedRoles: []string{"router", "vshard.storage"}, - }, - } - - for i, c := range cases { - roles, _ := GetRoles(c.pod) - if len(roles) != len(c.expectedRoles) { - t.Fatalf("%d: expected %d roles, got %d", i, len(c.expectedRoles), len(roles)) - } - - for _, v := range c.expectedRoles { - if Contains(roles, v) == false { - t.Fatalf("%d: roles must contain %s", i, v) - } - } - } -} diff --git a/controllers/topology/topology.go b/controllers/topology/topology.go deleted file mode 100644 index 60248755..00000000 --- a/controllers/topology/topology.go +++ /dev/null @@ -1,11 +0,0 @@ -package topology - -import ( - corev1 "k8s.io/api/core/v1" -) - -// TopologyService . -type TopologyService interface { - Join(p *corev1.Pod) error - Expel(p *corev1.Pod) error -} diff --git a/controllers/utils/utils.go b/controllers/utils/utils.go deleted file mode 100644 index bd3e6086..00000000 --- a/controllers/utils/utils.go +++ /dev/null @@ -1,20 +0,0 @@ -package utils - -func IsRolesEquals(rolesA, rolesB []string) bool { - isSubset := func(X, Y []string) bool { - for _, x := range X { - match := false - for _, y := range Y { - if x == y { - match = true - break - } - } - if !match { - return false - } - } - return true - } - return isSubset(rolesA, rolesB) && isSubset(rolesB, rolesA) -} diff --git a/controllers/utils/utils_test.go b/controllers/utils/utils_test.go deleted file mode 100644 index 1b046b9f..00000000 --- a/controllers/utils/utils_test.go +++ /dev/null @@ -1,82 +0,0 @@ -package utils - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("controller utils unit testing", func() { - Describe("function IsRolesEquals must compare two arrays of strings for equality regardless of the order of elements", func() { - Context("positive cases (equal arrays)", func() { - It("should return True if both arrays are empty", func() { - Expect( - IsRolesEquals([]string{}, []string{}), - ).Should(BeTrue()) - }) - - It("should return True if both arrays have len == 1", func() { - Expect( - IsRolesEquals([]string{"A"}, []string{"A"}), - ).Should(BeTrue()) - }) - - It("should return True if the elements are arranged in the same order", func() { - Expect( - IsRolesEquals( - []string{"A", "B", "C", "D", "E"}, - []string{"A", "B", "C", "D", "E"}, - ), - ).Should(BeTrue()) - }) - - It("should return True if the elements are arranged in a different order", func() { - Expect( - IsRolesEquals( - []string{"A", "B", "C", "D", "E"}, - []string{"B", "D", "E", "A", "C"}, - ), - ).Should(BeTrue()) - }) - }) - - Context("negative cases (unequal arrays)", func() { - It("should return False if one of the arrays is empty", func() { - By("first empty") - Expect( - IsRolesEquals([]string{}, []string{"A"}), - ).Should(BeFalse()) - - By("second empty") - Expect( - IsRolesEquals([]string{"A"}, []string{}), - ).Should(BeFalse()) - }) - - It("should return False if arrays are the same size, but the elements are different", func() { - Expect( - IsRolesEquals( - []string{"A", "B", "C", "D", "E"}, - []string{"Z", "F", "G", "C", "W"}, - ), - ).Should(BeFalse()) - }) - It("should return False if arrays are the different size", func() { - By("first more") - Expect( - IsRolesEquals( - []string{"A", "B", "C", "D", "E"}, - []string{"A", "B", "C", "D"}, - ), - ).Should(BeFalse()) - - By("second more") - Expect( - IsRolesEquals( - []string{"A", "B", "C", "D"}, - []string{"A", "B", "C", "D", "E"}, - ), - ).Should(BeFalse()) - }) - }) - }) -}) diff --git a/doc/README.md b/doc/README.md deleted file mode 100644 index 4787c892..00000000 --- a/doc/README.md +++ /dev/null @@ -1,20 +0,0 @@ -[![Crowdin](https://badges.crowdin.net/tarantool-operator/localized.svg)](https://crowdin.com/project/tarantool-operator) - -# Tarantool Kubernetes Operator documentation -Part of Tarantool documentation, published to -https://www.tarantool.io/en/doc/latest/book/cartridge/cartridge_kubernetes_guide/ - -## Create pot files from rst -```bash -python -m sphinx doc doc/locale/en -c doc -b gettext -``` - -## Create/update po from pot files -```bash -sphinx-intl update -p doc/locale/en -d doc/locale -l ru -``` - -## Build documentation to doc/output -```bash -python -m sphinx doc doc/output -c doc -``` diff --git a/doc/cartridge_kubernetes_guide/images/kubernetes-created-cluster-5px.png b/doc/cartridge_kubernetes_guide/images/kubernetes-created-cluster-5px.png deleted file mode 100644 index c3418c6b..00000000 Binary files a/doc/cartridge_kubernetes_guide/images/kubernetes-created-cluster-5px.png and /dev/null differ diff --git a/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicas-5px.png b/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicas-5px.png deleted file mode 100644 index 4d0f6120..00000000 Binary files a/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicas-5px.png and /dev/null differ diff --git a/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicasets-5px.png b/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicasets-5px.png deleted file mode 100644 index 871bb4fa..00000000 Binary files a/doc/cartridge_kubernetes_guide/images/kubernetes-increase-cluster-replicasets-5px.png and /dev/null differ diff --git a/doc/cartridge_kubernetes_guide/images/kubernetes-recreating-replicas-5px.png b/doc/cartridge_kubernetes_guide/images/kubernetes-recreating-replicas-5px.png deleted file mode 100644 index 5d090b0c..00000000 Binary files a/doc/cartridge_kubernetes_guide/images/kubernetes-recreating-replicas-5px.png and /dev/null differ diff --git a/doc/cartridge_kubernetes_guide/index.rst b/doc/cartridge_kubernetes_guide/index.rst deleted file mode 100644 index 43b95d8d..00000000 --- a/doc/cartridge_kubernetes_guide/index.rst +++ /dev/null @@ -1,1331 +0,0 @@ -.. _cartridge_kubernetes_guide: - -================================================================================ -Tarantool Cartridge on Kubernetes -================================================================================ - -This guide covers the full life cycle of a Tarantool Cartridge app--from -developing the app to operating it on Kubernetes. - -.. contents:: - -.. _cartridge_kubernetes_installing_tools: - --------------------------------------------------------------------------------- -Installation tools --------------------------------------------------------------------------------- - -The following tools are needed: - -1. **cartridge-cli** is a utility for managing Cartridge applications. - We need the version 2.3.0 or higher. Installation instructions are available - `here `__. - If the installation is successful, the *cartridge* utility will be available - in the system. - - .. code-block:: console - - $ cartridge version - --- - Tarantool Cartridge CLI v2.3.0 linux/amd64 commit: 06a5dad - -2. **kubectl** is a Kubernetes cluster management tool. We need the - version 1.16 or higher. Installation instructions can be found - `here `__. - - .. code-block:: console - - $ kubectl version --client - --- - Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} - -3. **helm** is a package manager for Kubernetes apps. We need the - version 3.3.x. Installation instructions can be found - `here `__. - - .. code-block:: console - - $ helm version - --- - version.BuildInfo{Version:"v3.3.1", GitCommit:"249e5215cde0c3fa72e27eb7a30e8d55c9696144", GitTreeState:"clean", GoVersion:"go1.14.7"} - -4. **minikube** is a tool for creating a local Kubernetes cluster. We - need the version 1.12 or higher. Installation instructions can be found - `here `__. - - .. code-block:: console - - $ minikube version - --- - minikube version: v1.17.1 - commit: 043bdca07e54ab6e4fc0457e3064048f34133d7e - - -5. **kind** (optional) is another tool for creating a local cluster. It - can be used instead of the minikube. We need the version 0.6.0 or higher. Installation instructions can be - found - `here `__. - - .. code-block:: console - - $ kind version - --- - kind v0.9.0 go1.15.2 linux/amd64 - -.. _cartridge_kubernetes_creating_an_application: - --------------------------------------------------------------------------------- -Creating an application --------------------------------------------------------------------------------- - -Let's create a Cartridge application named ``test-app`` using ``cartridge-cli``: - -.. code-block:: console - - $ cartridge create --name test-app - --- - • Create application test-app - • Generate application files - • Initialize application git repository - • Application "test-app" created successfully - -In the ``test-app`` directory, we get the app created from a template: - -.. code-block:: console - - $ ls test-app - --- - ... - - instances.yml - test-app-scm-1.rockspec - ... - -The app is fully functional and can respond to the HTTP GET request ``/hello``. - -.. NOTE:: - - Check the cartridge version in *test-app-scm-1.rockspec*: - - .. code:: lua - - dependencies = { - ... - 'cartridge == 2.3.0-1', - ... - } - - The version of Cartridge must be **>= 2.3.0**. Starting from this version, - Cartridge waits for an instance to become available on its DNS address during - the instance start. This is required for correct operations on Kubernetes. For - versions below 2.3.0, an application must be customized independently. - See the - `example `_ - of how to do this. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Building the application -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Let's create a Docker image using ``cartridge-cli``: - -.. code-block:: console - - $ cartridge pack docker --tag vanyarock01/test-app:0.1.0-0-g68f6117 - --- - ... - Running in 0ffbd57a0edf - Removing intermediate container 0ffbd57a0edf - ---> aceef7a3be63 - ---> aceef7a3be63 - Successfully built aceef7a3be63 - Successfully tagged test-app:0.1.0-0-g68f6117 - • Created result image test-app:0.1.0-0-g68f6117 - • Application was successfully packed - -Upload the image to the Docker registry: - -.. code-block:: console - - $ docker push vanyarock01/test-app:0.1.0-0-g68f6117 - --- - The push refers to repository [docker.io/vanyarock01/test-app] - b327b35afe0a: Pushed - de30ed3f758d: Pushed - 3c8808fbd85d: Pushed - 291f6e44771a: Pushed - 0.1.0-0-g275baa8: digest: sha256:5b3b92a615b34c7f132e72e2d61f692cf2091ca28be27bbbfed98106398d1c19 size: 1160 - -.. NOTE:: - - You must be logged in via ``docker login`` and have access rights - to the target registry. - -.. _cartridge_kubernetes_creating_a_kubernetes_cluster: - --------------------------------------------------------------------------------- -Creating a Kubernetes cluster --------------------------------------------------------------------------------- - -If you have a ready-made cluster in the cloud, you can use it. If not, we -suggest two ways of how to create a local cluster: - -* using :ref:`minikube ` -* using :ref:`kind `. - -.. _cartridge_kubernetes_creating_cluster_minikube: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Using *minikube* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Create a Kubernetes cluster of version 1.16.4 with 4GB of RAM (recommended): - -.. code-block:: console - - $ minikube start --kubernetes-version v1.16.4 --memory 4096 - --- - 😄 minikube v1.17.1 on Ubuntu 18.10 - ✨ Automatically selected the docker driver. Other choices: kvm2, virtualbox, ssh - 👍 Starting control plane node minikube in cluster minikube - 🚜 Pulling base image ... - 🔥 Creating docker container (CPUs=2, Memory=4096MB) ... - 🐳 Preparing Kubernetes v1.16.4 on Docker 20.10.2 ... - ▪ Generating certificates and keys ... - ▪ Booting up control plane ... - ▪ Configuring RBAC rules ... - 🔎 Verifying Kubernetes components... - 🌟 Enabled addons: storage-provisioner, default-storageclass - 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default - - -Wait for the cluster state to be *Ready*: - -.. code-block:: console - - $ kubectl get nodes - --- - NAME STATUS ROLES AGE VERSION - minikube Ready master 21m v1.16.4 - -.. _cartridge_kubernetes_creating_cluster_kind: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Using *kind* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Create a Kubernetes cluster of version 1.16.4 by using the *kind* utility as an -alternative to *minikube*: - -.. code-block:: console - - $ kind create cluster --image kindest/node:v1.16.4 - --- - Creating cluster "kind" ... - ✓ Ensuring node image (kindest/node:v1.16.4) 🖼 - ✓ Preparing nodes 📦 - ✓ Writing configuration 📜 - ✓ Starting control-plane 🕹️ - ✓ Installing CNI 🔌 - ✓ Installing StorageClass 💾 - Set kubectl context to "kind-kind" - You can now use your cluster with: - - kubectl cluster-info --context kind-kind - - Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/docs/user/quick-start/ - -Let's check the cluster status: - -.. code-block:: console - - $ kubectl get nodes - --- - NAME STATUS ROLES AGE VERSION - kind-control-plane Ready master 48s v1.16.4 - -.. _cartridge_kubernetes_launch_the_application: - --------------------------------------------------------------------------------- -Launch the application --------------------------------------------------------------------------------- - -To install the Tarantool Kubernetes operator and deploy the cluster, we will use -the ``helm`` utility. Charts are published in our repository. Let’s add it: - -.. code-block:: console - - $ helm repo add tarantool https://tarantool.github.io/tarantool-operator - -Two charts are available in the repository: - -.. code-block:: console - - $ helm search repo tarantool - --- - NAME CHART VERSION APP VERSION DESCRIPTION - tarantool/tarantool-operator 0.0.8 1.16.0 kubernetes tarantool operator - tarantool/cartridge 0.0.8 1.0 A Helm chart for tarantool - -The ``tarantool/tarantool-operator`` chart installs and configures the -operator that manages Tarantool Cartridge clusters. - -The ``tarantool/cartridge`` chart is a template for creating Tarantool -Cartridge clusters. With the default settings, this chart deploys an -example application consisting of 3 instances. The chart works only in -conjunction with the Tarantool Kubernetes operator. - -.. NOTE:: - - Use the same version with both charts. If you set the ``tarantool-operator`` - chart to version 0.0.8, set the ``cartridge`` chart to the same version 0.0.8. - -Install *tarantool-operator* in the *tarantool* namespace: - -.. code-block:: console - - $ helm install tarantool-operator tarantool/tarantool-operator --namespace tarantool --create-namespace --version 0.0.8 - --- - NAME: tarantool-operator - LAST DEPLOYED: Sun Sep 13 23:29:28 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 1 - TEST SUITE: None - -Let's wait until a pod with the operator is ready to work: - -.. code-block:: console - - $ kubectl get pods -n tarantool - --- - NAME READY STATUS RESTARTS AGE - tarantool-operator-xxx-yyy 0/1 Pending 0 3s - -In the meantime, let’s talk about what the Tarantool operator is and why -it is needed. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Tarantool Kubernetes operator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This is a Kubernetes application that can manage Tarantool Cartridge -resources. - -What does this mean for us? - -We don't need to know how to perform administrative actions such as -joining a node or creating a replica set. The operator knows how to do -this better, and if you set the value for its desired system -configuration, it begins to bring the cluster to the desired state. - -The Tarantool Kubernetes operator itself is an implementation of the Kubernetes -Operator design pattern. It offers the automation of work with user -resources using controllers that respond to various events and changes. - -The following links can help you understand this pattern: - -- `Official description on kubernetes.io `_; -- `Overview from the creators of the pattern (CoreOS) `_; -- `Post on Habr from Lamoda about the development of the operator `_. - -In the meantime, our pod with ``tarantool-operator`` went into a *Running* -state. The next step is to install the app using the ``tarantool/cartridge`` -helm chart. To do this, prepare a description of the desired system. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Deploying a Tarantool Cartridge application -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After you have deployed the cluster and installed the operator, you can -move to the next step--launching the app. - -We will deploy the app using the ``tarantool/cartridge`` chart. This is -a template. Run it with the default settings and get our example application -that has 3 instances. If you define your own settings, you can deploy any -application of any topology using the Tarantool Cartridge. - -Let's have a look at the settings in the ``values.yaml`` file. -Comments provide a description of each parameter: - -.. code-block:: yaml - - # Environment name and cluster name - ClusterEnv: "dev" - ClusterName: "test-app" - - # Docker image of the application - image: - repository: "vanyarock01/test-app" - tag: "0.1.0-0-g68f6117" - pullPolicy: "IfNotPresent" - - # The cluster topology includes a description of the number and - # characteristics of replicasets and is described in the RoleConfig section. - - # For example, we want to create a cluster containing two types of replicasets: - # routers and storages: - RoleConfig: - - RoleName: "routers" # Name of the replicaset type - ReplicaCount: 1 # Number of replicas in the replicaset - ReplicaSetCount: 1 # Number of replicasets for this role - DiskSize: "1Gi" # Persistent storage size - CPUallocation: 0.1 # Part of vCPUs allocated for each container - MemtxMemoryMB: 256 # Size of RAM allocated for each container - RolesToAssign: # Cartridge roles - - "app.roles.custom" - - "vshard-router" - - - RoleName: "storages" - ReplicaCount: 2 - ReplicaSetCount: 1 - DiskSize: "1Gi" - CPUallocation: 0.1 - MemtxMemoryMB: 256 - RolesToAssign: - - "app.roles.custom" - - "vshard-storage" - -With this configuration we will get the following: - -* A Tarantool Cartridge cluster called ``test-app``. -* Two replica sets in the cluster: ``routers`` and ``storages``. -* One Tarantool instance in the ``routers`` replica set. -* Two instances, master and replica, in the ``storages`` replica set. -* Each replica set performs the roles listed in the ``RolesToAssign`` parameter. - -Install the app: - -.. code-block:: console - - $ helm install -f values.yaml test-app tarantool/cartridge --namespace tarantool --version 0.0.8 - --- - NAME: test-app - LAST DEPLOYED: Mon Sep 14 10:46:50 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 1 - -Let's wait for all the pods to launch: - -.. code-block:: console - - $ kubectl -n tarantool get pods - NAME READY STATUS RESTARTS AGE - routers-0-0 0/1 Running 0 10s - storages-0-0 1/1 Running 0 10s - ... - tarantool-operator-xxx-yyy 1/1 Running 0 2m - -To check the cluster, we forward ports from one of the pods and go to -the Cartridge dashboard: - -.. code-block:: console - - $ kubectl port-forward -n tarantool routers-0-0 8081:8081 - -Now the Tarantool Cartridge Web UI is available at ``http://localhost:8081``. - -.. image:: images/kubernetes-created-cluster-5px.png - :align: left - :scale: 70% - -.. _cartridge_kubernetes_cluster_management: - --------------------------------------------------------------------------------- -Cluster management --------------------------------------------------------------------------------- - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Adding a new replica -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To increase the number of replicas in a replica set: - -1. Change the configuration in the ``values.yaml`` file. -2. Update the app using the ``helm upgrade`` command. - -The ``ReplicaCount`` parameter is responsible for the number of instances -in a replica set. Set it to ``3`` for the ``storages`` replica set: - -.. code:: yaml - - - RoleName: "storages" - ReplicaCount: 3 - ReplicaSetCount: 1 - DiskSize: "1Gi" - CPUallocation: 0.10 - MemtxMemoryMB: 256 - RolesToAssign: "custom.vshard-storage" - -Update the app: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool - --- - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Tue Sep 15 10:35:55 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 2 - -Let's wait until all the new pods go into the **Running** state and are -displayed in the Cartridge Web UI. - -.. image:: images/kubernetes-increase-cluster-replicas-5px.png - :align: left - :scale: 70% - -The ``storages`` replica set has 3 instances: 1 master and 2 replicas. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Adding a shard (replica set) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``ReplicaSetCount`` parameter defines the number of replicas of the same -type. - -Let's increase the number of the ``routers`` replica sets to ``2``: - -.. code:: yaml - - - RoleName: "routers" - ReplicaCount: 1 - ReplicaSetCount: 2 - DiskSize: "1Gi" - CPUallocation: 0.10 - MemtxMemoryMB: 256 - RolesToAssign: "custom.vshard-router" - -Update the app: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool - --- - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Tue Sep 15 10:37:57 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 3 - -Let's wait for the new pod to start: - -.. image:: images/kubernetes-increase-cluster-replicasets-5px.png - :align: left - :scale: 70% - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Updating application version -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Currently, the app logic contains one HTTP endpoint ``/hello`` that returns -the string ``Hello world!`` in response to a GET request. - -To check this out, let's forward the ports to the desired node: - -.. code-block:: console - - $ kubectl port-forward -n tarantool routers-0-0 8081:8081 - --- - Forwarding from 127.0.0.1:8081 -> 8081 - Forwarding from [::1]:8081 -> 8081 - -And then execute the request: - -.. code-block:: console - - $ curl http://localhost:8081/hello - --- - Hello world! - -Let's add another endpoint that will return the string "Hello world, new -version of the app!". To do this, add another ``httpd:route`` in the -``init`` function in the ``app/roles/custom.lua`` role: - -.. code:: lua - - local function init(opts) -- luacheck: no unused args - ... - -- new endpoint - httpd:route({method = 'GET', path = '/v2/hello'}, function() - return {body = 'Hello world, new version of the app!'} - end) - - ... - end - -Pack the new version of the app: - -.. code-block:: console - - $ cartridge pack docker --tag vanyarock01/test-app:0.1.0-1-g4577716 - - --- - - ... - Successfully tagged vanyarock01/test-app:0.1.0-1-g4577716 - • Created result image vanyarock01/test-app:0.1.0-1-g4577716 - • Application was successfully packed - -Upload the new image version to the Docker registry: - -.. code-block:: console - - $ docker push vanyarock01/test-app:0.1.0-1-g4577716 - -Update the ``values.yaml`` configuration file by specifying a new ``image.tag``: - -.. code:: yaml - - image: - repository: "vanyarock01/test-app" - tag: "0.1.0-1-g4577716" - pullPolicy: "IfNotPresent" - -Update the app on Kubernetes: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool - - --- - - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Tue Sep 15 10:45:53 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 4 - -Tarantool Kubernetes operator uses the **OnDelete** update policy. This means -that the update has reached the cluster, but the pods will update the app -image only after a restart: - -.. code-block:: console - - $ kubectl delete pods -l tarantool.io/cluster-id=test-app -n tarantool - --- - pod "routers-0-0" deleted - pod "routers-1-0" deleted - pod "storages-0-0" deleted - pod "storages-0-1" deleted - pod "storages-0-2" deleted - -Lets wait for the pods to start again and check the update: - -.. code-block:: console - - $ kubectl port-forward -n tarantool routers-0-0 8081:8081 - --- - Forwarding from 127.0.0.1:8081 -> 8081 - Forwarding from [::1]:8081 -> 8081 - ... - -.. code-block:: console - - curl http://localhost:8081/v2/hello - --- - Hello world, new version of the app! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Running multiple Tarantool Cartridge clusters in different namespaces -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Tarantool Kubernetes operator can manage Tarantool Cartridge clusters only in its -own namespace. Therefore, to deploy multiple Cartridge clusters in -different namespaces you need to deploy an operator in each of them. - -To install an operator in several namespaces, just specify the required -namespace during installation: - -.. code-block:: console - - $ helm install tarantool-operator tarantool/tarantool-operator --namespace NS_1 --create-namespace --version 0.0.8 - - $ helm install tarantool-operator tarantool/tarantool-operator --namespace NS_2 --create-namespace --version 0.0.8 - -These commands set the operator to the namespace ``NS_1`` and the namespace -``NS_2``. Then, in each of them, you can run a Tarantool Cartridge -cluster. - -.. code-block:: console - - $ helm install -f values.yaml cartridge tarantool/cartridge --namespace NS_1 --version 0.0.8 - - $ helm install -f values.yaml cartridge tarantool/cartridge --namespace NS_2 --version 0.0.8 - -Finally, we have two namespaces. Each has an operator and a Tarantool Cartridge -cluster. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Deleting a cluster -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To remove a cluster, execute the following command: - -.. code-block:: console - - $ helm uninstall test-app --namespace tarantool - --- - release "test-app" uninstalled - -After a while, all the pods of our application will disappear. Among the -pods in the ``tarantool`` namespace, only the Tarantool Kubernetes operator will -remain. - -.. code-block:: console - - $ kubectl get pods -n tarantool - --- - NAME READY STATUS RESTARTS AGE - tarantool-operator-xxx-yyy 1/1 Running 0 9m45s - -If you need to remove the Tarantool Kubernetes operator, execute: - -.. code-block:: console - - $ helm uninstall tarantool-operator --namespace tarantool - --- - release "tarantool-operator" uninstalled - -.. NOTE:: - - ``helm uninstall`` does not remove persistent volumes. To remove - them, you need to additionally perform the following: - - .. code-block:: console - - $ kubectl delete pvc --all -n tarantool - --- - persistentvolumeclaim "www-routers-0-0" deleted - persistentvolumeclaim "www-routers-1-0" deleted - persistentvolumeclaim "www-storages-0-0" deleted - - -.. _cartridge_kubernetes_cluster_management_failover: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Failover -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Failover - replicaset leader selection mechanism. You can read more about it -:ref:`in the Cartridge documentation `. - -.. NOTE:: - - The ability to configure failover via kubernetes manifests will appear later - -******************************************************************************** -Eventual mode -******************************************************************************** - -Default mode. Uses SWIM protocol to detect failures. - -******************************************************************************** -Stateful mode -******************************************************************************** - -Uses external storage for coordination. To work, you need to enable a ``failover-coordinator`` role on several instances. - -To do this, add the role in *values.yml* to the description of the replicasets: - -.. code-block:: yaml - - RoleConfig: - ... - - RoleName: storage - ReplicaCount: 1 - ReplicaSetCount: 1 - DiskSize: 1Gi - CPUallocation: 0.1 - MemtxMemoryMB: 256 - RolesToAssign: - - vshard-storage - - metrics - - failover-coordinator # added role - -.. NOTE:: - - Ability to update the roles is available in the Tarantool operator version later than 0.0.8 - -And run upgrading: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool - --- - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Wed Feb 3 14:40:34 2021 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 2 - -After we have at least one active role ``failover-coordinator``, we can enable stateful mode. It has two state providers: etcd and stateboard. - -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -etcd -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -The etcd cluster is deployed independently, if you don't have it - the easiest way to install etcd is `etcd-operator `_ with helm chart. - -We'll need a list of available etc cluster IP`s, the prefix for storage keys and credentials (user name and password). - -Read more about :ref:`setting up stateful failover `. - -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Stateboard -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -Read about :ref:`installing a stateboard ` -in the Cartridge documentation. - -.. _cartridge_kubernetes_troubleshooting: - --------------------------------------------------------------------------------- -Troubleshooting --------------------------------------------------------------------------------- - -When creating, updating, or scaling a cluster, errors may occur due to -lack of physical resources. - -Let's examine possible error indications, root causes and solutions. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Insufficient CPU -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After executing ``helm install / upgrade`` the pods remain in the -**Pending** state. - -It looks like this: - -.. code-block:: console - - $ kubectl get pods -n tarantool - --- - NAME READY STATUS RESTARTS AGE - routers-0-0 0/1 Pending 0 20m - routers-1-0 0/1 Pending 0 20m - storages-0-0 0/1 Pending 0 20m - tarantool-operator-xxx-yyy 1/1 Running 0 23m - -Let's take a look at the events of one of the pending pods: - -.. code-block:: console - - $ kubectl -n tarantool describe pods routers-0-0 - --- - Events: - Type Reason Age From Message - ---- ------ ---- ---- ------- - Warning FailedScheduling 34m default-scheduler 0/2 nodes are available: 2 Insufficient cpu. - Warning FailedScheduling 34m default-scheduler 0/2 nodes are available: 2 Insufficient cpu. - Normal NotTriggerScaleUp 3m33s (x175 over 34m) cluster-autoscaler pod didn't trigger scale-up (it wouldn't fit if a new node is added): - -It is now clear that we don't have enough CPU. You can reduce the -allocated CPU size in the ``values.yaml`` configuration file--the -``CPUallocation`` parameter. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Insufficient disk space -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After executing ``helm install/upgrade`` the pods remain in the -**ContainerCreating** state. Let's take a look at the events: - -.. code-block:: console - - $ kubectl -n tarantool describe pods routers-0-0 - --- - Events: - Type Reason Age From Message - ---- ------ ---- ---- ------- - Warning FailedScheduling 7m44s default-scheduler pod has unbound immediate PersistentVolumeClaims - Warning FailedScheduling 7m44s default-scheduler pod has unbound immediate PersistentVolumeClaims - Normal Scheduled 7m42s default-scheduler Successfully assigned tarantool/routers-0-0 to kubernetes-cluster-3010-default-group-0 - Normal SuccessfulAttachVolume 7m37s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-e0d3f30a-7dcc-4a67-a69d-4670dc77d556" - Warning FailedMount 67s (x9 over 7m5s) kubelet, kubernetes-cluster-3010-default-group-0 MountVolume.MountDevice failed for volume "pvc-e0d3f30a-7dcc-4a67-a69d-4670dc77d556" : rpc error: code = Internal desc = Unable to find Device path for volume - Warning FailedMount 66s (x3 over 5m38s) kubelet, kubernetes-cluster-3010-default-group-0 Unable to attach or mount volumes: unmounted volumes=[www], unattached volumes=[www default-token-jrz94]: timed out waiting for the condition - -Such events indicate that there is not enough disk space to create -storages. You can change the size of the allocated memory using the -``DiskSize`` parameter in the *values.yaml* file for replica sets. The -error can also be resolved by increasing the size of the physical -cluster disk. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CrashLoopBackOff status -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Pods do not start and have the status ``CrashLoopBackOff``. In short, -this means that the container starts and crashes soon after due to an -error in the code. - -.. code-block:: console - - $ kubectl -n tarantool get pods - --- - NAME READY STATUS RESTARTS AGE - routers-0-0 0/1 CrashLoopBackOff 6 8m4s - storages-0-0 0/1 CrashLoopBackOff 6 8m4s - tarantool-operator-b54fcb6f9-2xzpn 1/1 Running 0 12m - -Doing a kubectl describe pod will give us more information on that pod: - -.. code-block:: console - - $ kubectl -n tarantool describe pod routers-0-0 - --- - Events: - Type Reason Age From Message - ---- ------ ---- ---- ------- - ... - Normal Pulling 39m kubelet, minikube Pulling image "vanyarock01/test-app:0.1.0-1-g4577716" - Normal Pulled 39m kubelet, minikube Successfully pulled image "vanyarock01/test-app:0.1.0-1-g4577716" - Normal Created 37m (x5 over 39m) kubelet, minikube Created container pim-storage - Normal Pulled 37m (x4 over 39m) kubelet, minikube Container image "vanyarock01/test-app:0.1.0-1-g4577716" already present on machine - Normal Started 37m (x5 over 39m) kubelet, minikube Started container pim-storage - Warning BackOff 4m25s (x157 over 38m) kubelet, minikube Back-off restarting failed container - -We see that the container cannot start. Rather, the container starts, -but after starting it stops due to an internal error. To understand what -is happening to him, let's see it's logs: - -.. code-block:: console - - $ kubectl -n tarantool logs routers-0-0 - --- - 2021-02-28 15:18:59.866 [1] main/103/init.lua I> Using advertise_uri "routers-0-0.test-app.tarantool.svc.cluster.local:3301" - 2021-02-28 15:18:59.866 [1] main/103/init.lua I> Membership encryption enabled - 2021-02-28 15:18:59.963 [1] main/103/init.lua I> Probe uri was successful - 2021-02-28 15:18:59.964 [1] main/103/init.lua I> Membership BROADCAST sent to 127.0.0.1:3302 - 2021-02-28 15:19:00.061 [1] main/103/init.lua I> Membership BROADCAST sent to 172.17.255.255:3302 - 2021-02-28 15:19:00.062 [1] main/103/init.lua I> Membership BROADCAST sent to 127.0.0.1:3301 - 2021-02-28 15:19:00.063 [1] main/103/init.lua I> Membership BROADCAST sent to 172.17.255.255:3301 - 2021-02-28 15:19:00.064 [1] main/103/init.lua I> Membership BROADCAST sent to 127.0.0.1:3300 - 2021-02-28 15:19:00.065 [1] main/103/init.lua I> Membership BROADCAST sent to 172.17.255.255:3300 - 2021-02-28 15:19:00.066 [1] main/107/http/0.0.0.0:8081 I> started - 2021-02-28 15:19:00.069 [1] main/103/init.lua I> Listening HTTP on 0.0.0.0:8081 - 2021-02-28 15:19:00.361 [1] main/108/remote_control/0.0.0.0:3301 I> started - 2021-02-28 15:19:00.361 [1] main/103/init.lua I> Remote control bound to 0.0.0.0:3301 - 2021-02-28 15:19:00.362 [1] main/103/init.lua I> Remote control ready to accept connections - 2021-02-28 15:19:00.362 [1] main/103/init.lua I> Instance state changed: -> Unconfigured - 2021-02-28 15:19:00.365 [1] main/103/init.lua I> server alias routers-0-0 - 2021-02-28 15:19:00.365 [1] main/103/init.lua I> advertise uri routers-0-0.test-app.tarantool.svc.cluster.local:3301 - 2021-02-28 15:19:00.365 [1] main/103/init.lua I> working directory /var/lib/tarantool/test-app.routers-0-0 - 2021-02-28 15:19:00.365 [1] main utils.c:1014 E> LuajitError: /usr/share/tarantool/test-app/init.lua:42: unhandled error - 2021-02-28 15:19:00.365 [1] main F> fatal error, exiting the event loop - -We see that the application crashes with an error: ``unhandled error``. -This is an example of an error. In reality, there can be any other error -that leads to the crash of the Tarantool instance. Fix the bug in the -application and update the application to the new version. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Recreating replicas -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You may need to recreate the replicas: delete existing replicas, -create new ones and join them back to the replicaset. -Recreating replicas may be necessary when, for example, replication breaks down. - -Let's see how to do this. For example, you have a ``storage`` role: - -.. code-block:: yaml - - RoleConfig: - ... - - - RoleName: storage - ReplicaCount: 3 - ReplicaSetCount: 2 - DiskSize: 1Gi - CPUallocation: 0.1 - MemtxMemoryMB: 512 - RolesToAssign: - - vshard-storage - -Based on this description, after installation you will have the following pods: - -.. code-block:: console - - $ kubectl -n tarantool get pods - NAME READY STATUS RESTARTS AGE - --- - ... - storage-0-0 1/1 Running 0 2m42s - storage-0-1 1/1 Running 0 106s - storage-0-2 1/1 Running 0 80s - storage-1-0 1/1 Running 0 2m42s - storage-1-1 1/1 Running 0 111s - storage-1-2 1/1 Running 0 83s - tarantool-operator-7879d99ccb-6vrmg 1/1 Running 0 13m - -Let's try to reduce the number of replicas in the storage replicaset. To do -so, change the ``ReplicaCount`` number for the ``storage`` role from ``3`` to ``2`` -and run ``upgrade``: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool --version 0.0.8 - --- - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Tue Mar 2 11:45:29 2021 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 2 - -You will see that ``storage-0-2`` and ``storage-1-2`` become "Terminating" -and then disappear from the pods list: - -.. code-block:: console - - $ kubectl -n tarantool get pods - --- - NAME READY STATUS RESTARTS AGE - ... - storage-0-0 1/1 Running 0 12m - storage-0-1 1/1 Running 0 11m - storage-0-2 0/1 Terminating 0 11m - storage-1-0 1/1 Running 0 12m - storage-1-1 1/1 Running 0 11m - storage-1-2 0/1 Terminating 0 11m - tarantool-operator-xxx-yyy 1/1 Running 0 17m - -Let's check what the cluster looks like on the web UI: - -.. code-block:: console - - $ kubectl -n tarantool port-forward storage-0-0 8081:8081 - --- - Forwarding from 127.0.0.1:8081 -> 8081 - Forwarding from [::1]:8081 -> 8081 - -.. image:: images/kubernetes-recreating-replicas-5px.png - :align: left - :scale: 70% - :alt: Replicas storage-0-2 and storage-1-2 have a note "Server status is 'dead'" next to them. - -Here we have turned off every third replica of the ``storage`` role. -Note that we did not expel these replicas from the cluster. If we want to -return them and not lose data, return the required number of replicas -of the storage role and run ``upgrade`` again. - -However, if you need to delete some replicas' data, you can delete -the corresponding :abbr:`PVC (persistent volume claim)` before upgrading. - -.. code-block:: console - - $ kubectl -n tarantool get pvc - --- - NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE - ... - www-storage-0-0 Bound pvc-729c4827-e10e-4ede-b546-c72642935441 1Gi RWO standard 157m - www-storage-0-1 Bound pvc-6b2cfed2-171f-4b56-b290-3013b8472039 1Gi RWO standard 156m - www-storage-0-2 Bound pvc-147b0505-5380-4419-8d86-97db6a74775c 1Gi RWO standard 156m - www-storage-1-0 Bound pvc-788ad781-343b-43fe-867d-44432b1eabee 1Gi RWO standard 157m - www-storage-1-1 Bound pvc-4c8b334e-cf49-411b-8c4f-1c97e9baa93e 1Gi RWO standard 156m - www-storage-1-2 Bound pvc-c67d32c0-7d7b-4803-908e-065150f31189 1Gi RWO standard 156m - -It can be seen that the PVC pods that we deleted still exist. Let's remove data of the ``storage-1-2``: - -.. code-block:: console - - $ kubectl -n tarantool delete pvc www-storage-1-2 - --- - persistentvolumeclaim "www-storage-1-2" deleted - -Now you need to return the value ``3`` in the ``ReplicaCount`` field of the storage role and run ``upgrade``: - -.. code-block:: console - - $ helm upgrade -f values.yaml test-app tarantool/cartridge --namespace tarantool --version 0.0.8 - --- - Release "test-app" has been upgraded. Happy Helming! - NAME: test-app - LAST DEPLOYED: Tue Mar 2 14:42:06 2021 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 3 - -After a while, new pods will be up and configured. -The pod whose data was deleted may get stuck in the ``unconfigured`` -state. If this happens, try to restart it: - -.. code-block:: console - - $ kubectl -n tarantool delete pod storage-1-2 - --- - pod "storage-1-2" deleted - -Why does it work? The Tarantool operator does not expel nodes from the cluster, -but only "shuts them down". Therefore, it is impossible to reduce the -number of replicas in this way. But you can recreate it, since the UID -of each instance is generated based on its name, for example ``storage-1-2``. -This ensures that the new instance with the given name replaces the old one. - -This method is recommended only when there is no other way. -It has its own limitations: - -- Restarting nodes is possible only in descending order of the number in the replicaset. - If you have a replicaset with ``node-0-0``, ``node-0-1``, ``node-0-2``, and ``node-0-3``, - and you want to recreate only ``node-0-1``, then the nodes ``node-0-1``, ``node-0-2``, - and ``node-0-3`` will also restart with it. -- All nodes that belong to the selected role will be restarted. - It isn't possible to select a specific replicaset and only restart its instances. -- If the replicaset leader number is more than the number of restarted replica, - restarting can stop the leader. - It will make the replicaset unable to receive new write requests. - Please be very careful with reconnecting replicas. - - -.. _cartridge_kubernetes_customization: - --------------------------------------------------------------------------------- -Customization --------------------------------------------------------------------------------- - -For most cases, the ``tarantool/cartridge`` helm chart is enough for you. -However, if customization is required, you can continue to use the chart -by making your own changes. You can also ``deployment.yaml`` and ``kubectl`` instead -of ``helm``. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Sidecar containers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -What are they? With Kubernetes, it is possible to create several -containers inside one pod that share common resources such as disk -storage and network interfaces. Such containers are called sidecar. - -Learn more about this architectural pattern -`here `__. - -For implementation on Kubernetes, it is necessary to expand the -container park in the description of the required resource. Let's try to -add another service container with ``nginx`` to each pod containing a -container with a Tarantool instance based on -`this `_ -article. - -To do this, you will need to change the ``tarantool/cartridge`` chart. You -can find it -`here `__. -Add a new container with ``nginx`` to the ``ReplicasetTemplate`` which can be -found in the ``templates/deployment.yaml`` file. - -.. code:: yaml - - containers: - - name: "pim-storage" - image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}" - ... - - name: "nginx-container" - image: "nginx" - volumeMounts: - - name: "www" - mountPath: "/data" - -.. NOTE:: - - It is important to describe additional containers strictly - after the pim-storage container. Otherwise, problems may occur when - updating the version of the application. - - By default, the Tarantool Kubernetes operator - chooses the first one in the list as the application container. - -Now, let's start the installation specifying the path to the directory -with the customized chart: - -.. code-block:: console - - $ helm install -f values.yaml test-app tarantool-operator/examples/kv/helm-chart/ --namespace tarantool - --- - NAME: test-app - LAST DEPLOYED: Wed Sep 30 11:25:12 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 1 - -If everything goes well, it will be visible in the pod list: - -.. code-block:: console - - $ kubectl -n tarantool get pods - --- - NAME READY STATUS RESTARTS AGE - routers-0-0 2/2 Running 0 113s - routers-1-0 2/2 Running 0 113s - storages-0-0 2/2 Running 0 113s - tarantool-operator-xxx-yyy 1/1 Running 0 30m - -``READY 2/2`` means that 2 containers are ready inside the pod. - -.. _cartridge_kubernetes_installation_on_the_internal_network: - --------------------------------------------------------------------------------- -Installation in an internal network --------------------------------------------------------------------------------- - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Delivery of tools -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We need to bring the ``tarantool-cartridge`` and ``tarantool-operator`` -charts and the image of your application inside the internal network. - -You can download the charts from the following links: - -* `tarantool-operator v0.0.8 `_ -* `cartridge v0.0.8 `_. - -Next, you need to pack a Docker image with the ``tarantool-operator``. -First, let's pull the required version from the Docker Hub: - -.. code-block:: console - - $ docker pull tarantool/tarantool-operator:0.0.8 - --- - 0.0.8: Pulling from tarantool/tarantool-operator - 3c72a8ed6814: Pull complete - e6ffc8cffd54: Pull complete - cb731cdf9a11: Pull complete - a42b002f4072: Pull complete - Digest: sha256:e3b46c2a0231bd09a8cdc6c86eac2975211b2c597608bdd1e8510ee0054a9854 - Status: Downloaded newer image for tarantool/tarantool-operator:0.0.8 - docker.io/tarantool/tarantool-operator:0.0.8 - -And pack it into the archive: - -.. code-block:: console - - $ docker save tarantool/tarantool-operator:0.0.8 | gzip > tarantool-operator-0.0.8.tar.gz - -After delivering the archive with the container to the target location, -you need to load the image to your Docker: - -.. code-block:: console - - $ docker load < tarantool-operator-0.0.8.tar.gz - --- - Loaded image: tarantool/tarantool-operator:0.0.8 - -All that remains is to push the image to the internal Docker registry. We -will use an example Docker registry hosted on ``localhost:5000``: - -.. code-block:: console - - $ docker tag tarantool/tarantool-operator:0.0.8 localhost:5000/tarantool-operator:0.0.8 - - $ docker push localhost:5000/tarantool-operator:0.0.8 - --- - The push refers to repository [localhost:5000/tarantool-operator] - febd47bb69b9: Pushed - bacec9f8c1dd: Pushed - d1d164c2f681: Pushed - 291f6e44771a: Pushed - 0.0.8: digest: sha256:e3b46c2a0231bd09a8cdc6c86eac2975211b2c597608bdd1e8510ee0054a9854 size: 1155 - -.. NOTE:: - - You can deliver the image with the application using the - method described above. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Installing the Tarantool Kubernetes operator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Let's describe the custom operator values in the -``operator_values.yaml`` file: - -.. code:: yaml - - image: - # internal Docker repository - repository: "localhost:5000/tarantool-operator" - tag: "0.0.8" - pullPolicy: "IfNotPresent" - -And install the operator specifying the path to the archive with chart: - -.. code-block:: console - - $ helm install tarantool-operator -f operator_values.yaml ./tarantool-operator-0.0.8.tgz --namespace tarantool --create-namespace - --- - NAME: tarantool-operator - LAST DEPLOYED: Tue Dec 1 14:53:47 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 1 - TEST SUITE: None - -Check the installation: - -.. code-block:: console - - $ kubectl -n tarantool get pods - --- - NAME READY STATUS RESTARTS AGE - tarantool-operator-xxx-yyy 1/1 Running 0 7s - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Installing the Tarantool Cartridge app -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We have pushed the app image to the local Docker registry beforehand. What -remains is to customize the ``values.yaml`` file by specifying the available -repository: - -.. code:: yaml - - ... - image: - repository: "localhost:5000/test-app" - tag: "0.1.0-0-g68f6117" - pullPolicy: "IfNotPresent" - ... - -The complete configuration of the ``values.yaml`` can be found in the -instructions for installing the Tarantool Cartridge application -described in the guide earlier. - -It remains to unpack the Cartridge chart: - -.. code-block:: console - - $ tar -xzf tarantool-operator-cartridge-0.0.8.tar.gz - -And run the installation by specifying the path to the chart: - -.. code-block:: console - - $ helm install -f values.yaml test-app tarantool-operator-cartridge-0.0.8/examples/kv/helm-chart/ --namespace tarantool - --- - NAME: test-app - LAST DEPLOYED: Tue Dec 1 15:52:41 2020 - NAMESPACE: tarantool - STATUS: deployed - REVISION: 1 - -Let's take a look at the pods to make sure the installation is -successful: - -.. code-block:: console - - $ kubectl -n tarantool get pods - --- - NAME READY STATUS RESTARTS AGE - routers-0-0 1/1 Running 0 8m30s - storages-0-0 1/1 Running 0 8m30s - storages-1-0 1/1 Running 0 8m30s - tarantool-operator-xxx-yyy 1/1 Running 0 67m - -.. |image2| image:: images/kubernetes-increase-cluster-replicas.png -.. |image3| image:: images/kubernetes-increase-cluster-replicasets.png diff --git a/doc/cleanup.py b/doc/cleanup.py deleted file mode 100755 index ed45c18d..00000000 --- a/doc/cleanup.py +++ /dev/null @@ -1,46 +0,0 @@ -#! /usr/bin/env python3 -import argparse -from glob import glob -from polib import pofile, POFile, _BaseFile - -parser = argparse.ArgumentParser(description='Cleanup PO and POT files') -parser.add_argument('extension', type=str, choices=['po', 'pot', 'both'], - help='cleanup files with extension: po, pot or both') - - -class PoFile(POFile): - - def __unicode__(self): - return _BaseFile.__unicode__(self) - - def metadata_as_entry(self): - class M: - def __unicode__(self, _): - return '' - return M() - - -def cleanup_files(extension): - mask = f'**/*.{extension}' - for file_path in glob(mask, recursive=True): - print(f'cleanup {file_path}') - po_file: POFile = pofile(file_path, klass=PoFile) - po_file.header = '' - po_file.metadata = {} - po_file.metadata_is_fuzzy = False - - for item in po_file: - item.occurrences = None - - po_file.save() - - -if __name__ == "__main__": - - args = parser.parse_args() - - if args.extension in ['po', 'both']: - cleanup_files('po') - - if args.extension in ['pot', 'both']: - cleanup_files('pot') diff --git a/doc/conf.py b/doc/conf.py deleted file mode 100644 index b2587732..00000000 --- a/doc/conf.py +++ /dev/null @@ -1,23 +0,0 @@ -import sys -import os - -sys.path.insert(0, os.path.abspath('')) - -master_doc = 'doc/cartridge_kubernetes_guide/index' - -source_suffix = '.rst' - -project = u'Tarantool-operator' - -exclude_patterns = [ - 'doc/locale', - 'doc/output', - 'doc/README.md', - 'doc/cleanup.py', - 'doc/requirements.txt', -] - -language = 'en' -locale_dirs = ['./doc/locale'] -gettext_compact = False -gettext_location = True diff --git a/doc/crowdin.yaml b/doc/crowdin.yaml deleted file mode 100644 index 81b756fc..00000000 --- a/doc/crowdin.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# https://support.crowdin.com/configuration-file/ -# https://support.crowdin.com/cli-tool-v3/#configuration - -"project_id" : "463364" -"base_path" : "doc/locale" -"base_url": "https://crowdin.com" -"api_token_env": "CROWDIN_PERSONAL_TOKEN" - - -"preserve_hierarchy": true - -files: [ - { - "source" : "/en/**/*.pot", - "translation" : "/%locale_with_underscore%/LC_MESSAGES/**/%file_name%.po", - "update_option" : "update_as_unapproved", - - "languages_mapping" : { - "locale_with_underscore" : { - "ru" : "ru", - } - }, - } -] diff --git a/doc/locale/ru/LC_MESSAGES/cartridge_kubernetes_guide/index.po b/doc/locale/ru/LC_MESSAGES/cartridge_kubernetes_guide/index.po deleted file mode 100644 index 5822ffe6..00000000 --- a/doc/locale/ru/LC_MESSAGES/cartridge_kubernetes_guide/index.po +++ /dev/null @@ -1,807 +0,0 @@ - -msgid "Tarantool Cartridge on Kubernetes" -msgstr "" - -msgid "" -"This guide covers the full life cycle of a Tarantool Cartridge app--from " -"developing the app to operating it on Kubernetes." -msgstr "" - -msgid "Contents" -msgstr "" - -msgid "Installation tools" -msgstr "" - -msgid "The following tools are needed:" -msgstr "" - -msgid "" -"**cartridge-cli** is a utility for managing Cartridge applications. We need " -"the version 2.3.0 or higher. Installation instructions are available `here " -"`__. If the " -"installation is successful, the *cartridge* utility will be available in the" -" system." -msgstr "" - -msgid "" -"**kubectl** is a Kubernetes cluster management tool. We need the version " -"1.16 or higher. Installation instructions can be found `here " -"`__." -msgstr "" - -msgid "" -"**helm** is a package manager for Kubernetes apps. We need the version " -"3.3.x. Installation instructions can be found `here " -"`__." -msgstr "" - -msgid "" -"**minikube** is a tool for creating a local Kubernetes cluster. We need the " -"version 1.12 or higher. Installation instructions can be found `here " -"`__." -msgstr "" - -msgid "" -"**kind** (optional) is another tool for creating a local cluster. It can be " -"used instead of the minikube. We need the version 0.6.0 or higher. " -"Installation instructions can be found `here " -"`__." -msgstr "" - -msgid "Creating an application" -msgstr "" - -msgid "" -"Let's create a Cartridge application named ``test-app`` using ``cartridge-" -"cli``:" -msgstr "" - -msgid "In the ``test-app`` directory, we get the app created from a template:" -msgstr "" - -msgid "" -"The app is fully functional and can respond to the HTTP GET request " -"``/hello``." -msgstr "" - -msgid "Check the cartridge version in *test-app-scm-1.rockspec*:" -msgstr "" - -msgid "" -"The version of Cartridge must be **>= 2.3.0**. Starting from this version, " -"Cartridge waits for an instance to become available on its DNS address " -"during the instance start. This is required for correct operations on " -"Kubernetes. For versions below 2.3.0, an application must be customized " -"independently. See the `example `_ of how " -"to do this." -msgstr "" - -msgid "Building the application" -msgstr "" - -msgid "Let's create a Docker image using ``cartridge-cli``:" -msgstr "" - -msgid "Upload the image to the Docker registry:" -msgstr "" - -msgid "" -"You must be logged in via ``docker login`` and have access rights to the " -"target registry." -msgstr "" - -msgid "Creating a Kubernetes cluster" -msgstr "" - -msgid "" -"If you have a ready-made cluster in the cloud, you can use it. If not, we " -"suggest two ways of how to create a local cluster:" -msgstr "" - -msgid "using :ref:`minikube `" -msgstr "" - -msgid "using :ref:`kind `." -msgstr "" - -msgid "Using *minikube*" -msgstr "" - -msgid "" -"Create a Kubernetes cluster of version 1.16.4 with 4GB of RAM (recommended):" -msgstr "" - -msgid "Wait for the cluster state to be *Ready*:" -msgstr "" - -msgid "Using *kind*" -msgstr "" - -msgid "" -"Create a Kubernetes cluster of version 1.16.4 by using the *kind* utility as" -" an alternative to *minikube*:" -msgstr "" - -msgid "Let's check the cluster status:" -msgstr "" - -msgid "Launch the application" -msgstr "" - -msgid "" -"To install the Tarantool Kubernetes operator and deploy the cluster, we will" -" use the ``helm`` utility. Charts are published in our repository. Let’s add" -" it:" -msgstr "" - -msgid "Two charts are available in the repository:" -msgstr "" - -msgid "" -"The ``tarantool/tarantool-operator`` chart installs and configures the " -"operator that manages Tarantool Cartridge clusters." -msgstr "" - -msgid "" -"The ``tarantool/cartridge`` chart is a template for creating Tarantool " -"Cartridge clusters. With the default settings, this chart deploys an example" -" application consisting of 3 instances. The chart works only in conjunction " -"with the Tarantool Kubernetes operator." -msgstr "" - -msgid "" -"Use the same version with both charts. If you set the ``tarantool-operator``" -" chart to version 0.0.8, set the ``cartridge`` chart to the same version " -"0.0.8." -msgstr "" - -msgid "Install *tarantool-operator* in the *tarantool* namespace:" -msgstr "" - -msgid "Let's wait until a pod with the operator is ready to work:" -msgstr "" - -msgid "" -"In the meantime, let’s talk about what the Tarantool operator is and why it " -"is needed." -msgstr "" - -msgid "Tarantool Kubernetes operator" -msgstr "" - -msgid "" -"This is a Kubernetes application that can manage Tarantool Cartridge " -"resources." -msgstr "" - -msgid "What does this mean for us?" -msgstr "" - -msgid "" -"We don't need to know how to perform administrative actions such as joining " -"a node or creating a replica set. The operator knows how to do this better, " -"and if you set the value for its desired system configuration, it begins to " -"bring the cluster to the desired state." -msgstr "" - -msgid "" -"The Tarantool Kubernetes operator itself is an implementation of the " -"Kubernetes Operator design pattern. It offers the automation of work with " -"user resources using controllers that respond to various events and changes." -msgstr "" - -msgid "The following links can help you understand this pattern:" -msgstr "" - -msgid "" -"`Official description on kubernetes.io " -"`_;" -msgstr "" - -msgid "" -"`Overview from the creators of the pattern (CoreOS) " -"`_;" -msgstr "" - -msgid "" -"`Post on Habr from Lamoda about the development of the operator " -"`_." -msgstr "" - -msgid "" -"In the meantime, our pod with ``tarantool-operator`` went into a *Running* " -"state. The next step is to install the app using the ``tarantool/cartridge``" -" helm chart. To do this, prepare a description of the desired system." -msgstr "" - -msgid "Deploying a Tarantool Cartridge application" -msgstr "" - -msgid "" -"After you have deployed the cluster and installed the operator, you can move" -" to the next step--launching the app." -msgstr "" - -msgid "" -"We will deploy the app using the ``tarantool/cartridge`` chart. This is a " -"template. Run it with the default settings and get our example application " -"that has 3 instances. If you define your own settings, you can deploy any " -"application of any topology using the Tarantool Cartridge." -msgstr "" - -msgid "" -"Let's have a look at the settings in the ``values.yaml`` file. Comments " -"provide a description of each parameter:" -msgstr "" - -msgid "With this configuration we will get the following:" -msgstr "" - -msgid "A Tarantool Cartridge cluster called ``test-app``." -msgstr "" - -msgid "Two replica sets in the cluster: ``routers`` and ``storages``." -msgstr "" - -msgid "One Tarantool instance in the ``routers`` replica set." -msgstr "" - -msgid "Two instances, master and replica, in the ``storages`` replica set." -msgstr "" - -msgid "" -"Each replica set performs the roles listed in the ``RolesToAssign`` " -"parameter." -msgstr "" - -msgid "Install the app:" -msgstr "" - -msgid "Let's wait for all the pods to launch:" -msgstr "" - -msgid "" -"To check the cluster, we forward ports from one of the pods and go to the " -"Cartridge dashboard:" -msgstr "" - -msgid "" -"Now the Tarantool Cartridge Web UI is available at " -"``http://localhost:8081``." -msgstr "" - -msgid "Cluster management" -msgstr "" - -msgid "Adding a new replica" -msgstr "" - -msgid "To increase the number of replicas in a replica set:" -msgstr "" - -msgid "Change the configuration in the ``values.yaml`` file." -msgstr "" - -msgid "Update the app using the ``helm upgrade`` command." -msgstr "" - -msgid "" -"The ``ReplicaCount`` parameter is responsible for the number of instances in" -" a replica set. Set it to ``3`` for the ``storages`` replica set:" -msgstr "" - -msgid "Update the app:" -msgstr "" - -msgid "" -"Let's wait until all the new pods go into the **Running** state and are " -"displayed in the Cartridge Web UI." -msgstr "" - -msgid "The ``storages`` replica set has 3 instances: 1 master and 2 replicas." -msgstr "" - -msgid "Adding a shard (replica set)" -msgstr "" - -msgid "" -"The ``ReplicaSetCount`` parameter defines the number of replicas of the same" -" type." -msgstr "" - -msgid "Let's increase the number of the ``routers`` replica sets to ``2``:" -msgstr "" - -msgid "Let's wait for the new pod to start:" -msgstr "" - -msgid "Updating application version" -msgstr "" - -msgid "" -"Currently, the app logic contains one HTTP endpoint ``/hello`` that returns " -"the string ``Hello world!`` in response to a GET request." -msgstr "" - -msgid "To check this out, let's forward the ports to the desired node:" -msgstr "" - -msgid "And then execute the request:" -msgstr "" - -msgid "" -"Let's add another endpoint that will return the string \"Hello world, new " -"version of the app!\". To do this, add another ``httpd:route`` in the " -"``init`` function in the ``app/roles/custom.lua`` role:" -msgstr "" - -msgid "Pack the new version of the app:" -msgstr "" - -msgid "Upload the new image version to the Docker registry:" -msgstr "" - -msgid "" -"Update the ``values.yaml`` configuration file by specifying a new " -"``image.tag``:" -msgstr "" - -msgid "Update the app on Kubernetes:" -msgstr "" - -msgid "" -"Tarantool Kubernetes operator uses the **OnDelete** update policy. This " -"means that the update has reached the cluster, but the pods will update the " -"app image only after a restart:" -msgstr "" - -msgid "Lets wait for the pods to start again and check the update:" -msgstr "" - -msgid "Running multiple Tarantool Cartridge clusters in different namespaces" -msgstr "" - -msgid "" -"Tarantool Kubernetes operator can manage Tarantool Cartridge clusters only " -"in its own namespace. Therefore, to deploy multiple Cartridge clusters in " -"different namespaces you need to deploy an operator in each of them." -msgstr "" - -msgid "" -"To install an operator in several namespaces, just specify the required " -"namespace during installation:" -msgstr "" - -msgid "" -"These commands set the operator to the namespace ``NS_1`` and the namespace " -"``NS_2``. Then, in each of them, you can run a Tarantool Cartridge cluster." -msgstr "" - -msgid "" -"Finally, we have two namespaces. Each has an operator and a Tarantool " -"Cartridge cluster." -msgstr "" - -msgid "Deleting a cluster" -msgstr "" - -msgid "To remove a cluster, execute the following command:" -msgstr "" - -msgid "" -"After a while, all the pods of our application will disappear. Among the " -"pods in the ``tarantool`` namespace, only the Tarantool Kubernetes operator " -"will remain." -msgstr "" - -msgid "If you need to remove the Tarantool Kubernetes operator, execute:" -msgstr "" - -msgid "" -"``helm uninstall`` does not remove persistent volumes. To remove them, you " -"need to additionally perform the following:" -msgstr "" - -msgid "Failover" -msgstr "" - -msgid "" -"Failover - replicaset leader selection mechanism. You can read more about it" -" `here " -"`__." -msgstr "" - -msgid "" -"The ability to configure failover via kubernetes manifests will appear later" -msgstr "" - -msgid "Eventual mode" -msgstr "" - -msgid "Default mode. Uses SWIM protocol to detect failures." -msgstr "" - -msgid "Stateful mode" -msgstr "" - -msgid "" -"Uses external storage for coordination. To work, you need to enable a " -"``failover-coordinator`` role on several instances." -msgstr "" - -msgid "" -"To do this, add the role in *values.yml* to the description of the " -"replicasets:" -msgstr "" - -msgid "" -"Ability to update the roles is available in the Tarantool operator version " -"later than 0.0.8" -msgstr "" - -msgid "And run upgrading:" -msgstr "" - -msgid "" -"After we have at least one active role ``failover-coordinator``, we can " -"enable stateful mode. It has two state providers: etcd and stateboard." -msgstr "" - -msgid "etcd" -msgstr "" - -msgid "" -"The etcd cluster is deployed independently, if you don't have it - the " -"easiest way to install etcd is `etcd-operator " -"`_ with " -"helm chart." -msgstr "" - -msgid "" -"We'll need a list of available etc cluster IP`s, the prefix for storage keys" -" and credentials (user name and password)." -msgstr "" - -msgid "" -"How to set up stateful failover can be found on the documentation `page " -"`__." -msgstr "" - -msgid "Stateboard" -msgstr "" - -msgid "" -"How to install a stateboard can be found on this documentation `page " -"`__." -msgstr "" - -msgid "Troubleshooting" -msgstr "" - -msgid "" -"When creating, updating, or scaling a cluster, errors may occur due to lack " -"of physical resources." -msgstr "" - -msgid "Let's examine possible error indications, root causes and solutions." -msgstr "" - -msgid "Insufficient CPU" -msgstr "" - -msgid "" -"After executing ``helm install / upgrade`` the pods remain in the " -"**Pending** state." -msgstr "" - -msgid "It looks like this:" -msgstr "" - -msgid "Let's take a look at the events of one of the pending pods:" -msgstr "" - -msgid "" -"It is now clear that we don't have enough CPU. You can reduce the allocated " -"CPU size in the ``values.yaml`` configuration file--the ``CPUallocation`` " -"parameter." -msgstr "" - -msgid "Insufficient disk space" -msgstr "" - -msgid "" -"After executing ``helm install/upgrade`` the pods remain in the " -"**ContainerCreating** state. Let's take a look at the events:" -msgstr "" - -msgid "" -"Such events indicate that there is not enough disk space to create storages." -" You can change the size of the allocated memory using the ``DiskSize`` " -"parameter in the *values.yaml* file for replica sets. The error can also be " -"resolved by increasing the size of the physical cluster disk." -msgstr "" - -msgid "CrashLoopBackOff status" -msgstr "" - -msgid "" -"Pods do not start and have the status ``CrashLoopBackOff``. In short, this " -"means that the container starts and crashes soon after due to an error in " -"the code." -msgstr "" - -msgid "" -"Doing a kubectl describe pod will give us more information on that pod:" -msgstr "" - -msgid "" -"We see that the container cannot start. Rather, the container starts, but " -"after starting it stops due to an internal error. To understand what is " -"happening to him, let's see it's logs:" -msgstr "" - -msgid "" -"We see that the application crashes with an error: ``unhandled error``. This" -" is an example of an error. In reality, there can be any other error that " -"leads to the crash of the Tarantool instance. Fix the bug in the application" -" and update the application to the new version." -msgstr "" - -msgid "Recreating replicas" -msgstr "" - -msgid "" -"You may need to recreate the replicas: delete existing replicas, create new " -"ones and join them back to the replicaset. Recreating replicas may be " -"necessary when, for example, replication breaks down." -msgstr "" - -msgid "Let's see how to do this. For example, you have a ``storage`` role:" -msgstr "" - -msgid "" -"Based on this description, after installation you will have the following " -"pods:" -msgstr "" - -msgid "" -"Let's try to reduce the number of replicas in the storage replicaset. To do " -"so, change the ``ReplicaCount`` number for the ``storage`` role from ``3`` " -"to ``2`` and run ``upgrade``:" -msgstr "" - -msgid "" -"You will see that ``storage-0-2`` and ``storage-1-2`` become \"Terminating\"" -" and then disappear from the pods list:" -msgstr "" - -msgid "Let's check what the cluster looks like on the web UI:" -msgstr "" - -msgid "" -"Replicas storage-0-2 and storage-1-2 have a note \"Server status is 'dead'\"" -" next to them." -msgstr "" - -msgid "" -"Here we have turned off every third replica of the ``storage`` role. Note " -"that we did not expel these replicas from the cluster. If we want to return " -"them and not lose data, return the required number of replicas of the " -"storage role and run ``upgrade`` again." -msgstr "" - -msgid "" -"However, if you need to delete some replicas' data, you can delete the " -"corresponding :abbr:`PVC (persistent volume claim)` before upgrading." -msgstr "" - -msgid "" -"It can be seen that the PVC pods that we deleted still exist. Let's remove " -"data of the ``storage-1-2``:" -msgstr "" - -msgid "" -"Now you need to return the value ``3`` in the ``ReplicaCount`` field of the " -"storage role and run ``upgrade``:" -msgstr "" - -msgid "" -"After a while, new pods will be up and configured. The pod whose data was " -"deleted may get stuck in the ``unconfigured`` state. If this happens, try to" -" restart it:" -msgstr "" - -msgid "" -"Why does it work? The Tarantool operator does not expel nodes from the " -"cluster, but only \"shuts them down\". Therefore, it is impossible to reduce" -" the number of replicas in this way. But you can recreate it, since the UID " -"of each instance is generated based on its name, for example " -"``storage-1-2``. This ensures that the new instance with the given name " -"replaces the old one." -msgstr "" - -msgid "" -"This method is recommended only when there is no other way. It has its own " -"limitations:" -msgstr "" - -msgid "" -"Restarting nodes is possible only in descending order of the number in the " -"replicaset. If you have a replicaset with ``node-0-0``, ``node-0-1``, " -"``node-0-2``, and ``node-0-3``, and you want to recreate only ``node-0-1``, " -"then the nodes ``node-0-1``, ``node-0-2``, and ``node-0-3`` will also " -"restart with it." -msgstr "" - -msgid "" -"All nodes that belong to the selected role will be restarted. It isn't " -"possible to select a specific replicaset and only restart its instances." -msgstr "" - -msgid "" -"If the replicaset leader number is more than the number of restarted " -"replica, restarting can stop the leader. It will make the replicaset unable " -"to receive new write requests. Please be very careful with reconnecting " -"replicas." -msgstr "" - -msgid "Customization" -msgstr "" - -msgid "" -"For most cases, the ``tarantool/cartridge`` helm chart is enough for you. " -"However, if customization is required, you can continue to use the chart by " -"making your own changes. You can also ``deployment.yaml`` and ``kubectl`` " -"instead of ``helm``." -msgstr "" - -msgid "Sidecar containers" -msgstr "" - -msgid "" -"What are they? With Kubernetes, it is possible to create several containers " -"inside one pod that share common resources such as disk storage and network " -"interfaces. Such containers are called sidecar." -msgstr "" - -msgid "" -"Learn more about this architectural pattern `here " -"`__." -msgstr "" - -msgid "" -"For implementation on Kubernetes, it is necessary to expand the container " -"park in the description of the required resource. Let's try to add another " -"service container with ``nginx`` to each pod containing a container with a " -"Tarantool instance based on `this `_ " -"article." -msgstr "" - -msgid "" -"To do this, you will need to change the ``tarantool/cartridge`` chart. You " -"can find it `here `__. Add a new container with " -"``nginx`` to the ``ReplicasetTemplate`` which can be found in the " -"``templates/deployment.yaml`` file." -msgstr "" - -msgid "" -"It is important to describe additional containers strictly after the pim-" -"storage container. Otherwise, problems may occur when updating the version " -"of the application." -msgstr "" - -msgid "" -"By default, the Tarantool Kubernetes operator chooses the first one in the " -"list as the application container." -msgstr "" - -msgid "" -"Now, let's start the installation specifying the path to the directory with " -"the customized chart:" -msgstr "" - -msgid "If everything goes well, it will be visible in the pod list:" -msgstr "" - -msgid "``READY 2/2`` means that 2 containers are ready inside the pod." -msgstr "" - -msgid "Installation in an internal network" -msgstr "" - -msgid "Delivery of tools" -msgstr "" - -msgid "" -"We need to bring the ``tarantool-cartridge`` and ``tarantool-operator`` " -"charts and the image of your application inside the internal network." -msgstr "" - -msgid "You can download the charts from the following links:" -msgstr "" - -msgid "" -"`tarantool-operator v0.0.8 `_" -msgstr "" - -msgid "" -"`cartridge v0.0.8 `_." -msgstr "" - -msgid "" -"Next, you need to pack a Docker image with the ``tarantool-operator``. " -"First, let's pull the required version from the Docker Hub:" -msgstr "" - -msgid "And pack it into the archive:" -msgstr "" - -msgid "" -"After delivering the archive with the container to the target location, you " -"need to load the image to your Docker:" -msgstr "" - -msgid "" -"All that remains is to push the image to the internal Docker registry. We " -"will use an example Docker registry hosted on ``localhost:5000``:" -msgstr "" - -msgid "" -"You can deliver the image with the application using the method described " -"above." -msgstr "" - -msgid "Installing the Tarantool Kubernetes operator" -msgstr "" - -msgid "" -"Let's describe the custom operator values in the ``operator_values.yaml`` " -"file:" -msgstr "" - -msgid "" -"And install the operator specifying the path to the archive with chart:" -msgstr "" - -msgid "Check the installation:" -msgstr "" - -msgid "Installing the Tarantool Cartridge app" -msgstr "" - -msgid "" -"We have pushed the app image to the local Docker registry beforehand. What " -"remains is to customize the ``values.yaml`` file by specifying the available" -" repository:" -msgstr "" - -msgid "" -"The complete configuration of the ``values.yaml`` can be found in the " -"instructions for installing the Tarantool Cartridge application described in" -" the guide earlier." -msgstr "" - -msgid "It remains to unpack the Cartridge chart:" -msgstr "" - -msgid "And run the installation by specifying the path to the chart:" -msgstr "" - -msgid "" -"Let's take a look at the pods to make sure the installation is successful:" -msgstr "" - -msgid "image2" -msgstr "" - -msgid "image3" -msgstr "" diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 2fe89f07..00000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -Sphinx==4.0.2 -sphinx-intl==2.0.1 -polib==1.1.1 diff --git a/docs/assets/before-migration.png b/docs/assets/before-migration.png new file mode 100644 index 00000000..eecc8655 Binary files /dev/null and b/docs/assets/before-migration.png differ diff --git a/docs/assets/migration.png b/docs/assets/migration.png new file mode 100644 index 00000000..d39da509 Binary files /dev/null and b/docs/assets/migration.png differ diff --git a/docs/deploy-example-application.md b/docs/deploy-example-application.md new file mode 100644 index 00000000..d03a36ed --- /dev/null +++ b/docs/deploy-example-application.md @@ -0,0 +1,47 @@ +# Deploy example application + +This guide provides the instructions how to install the example cartridge application. +To deploy your own application you'd need to build your own docker image +via [Cartridge CLI](https://www.tarantool.io/en/doc/latest/book/cartridge/cartridge_cli/commands/pack/docker/). + +### Install or update application using Helm + +To install or upgrade the Cartridge App using Helm, run following commands from the shell: + +- Add helm repository + ```shell + helm repo add tarantool https://tarantool.github.io/helm-charts/ + ``` + +- Configure application params + ```shell + helm show values tarantool/cartridge > values.yaml + ``` + Edit `values.yaml` file to configure your deployment, the most useful variables described [here](#useful-helm-variables) + +- Install/update app: + - Replace the `my-namespace` with any name of namespace what you want. + - Add the `--create-namespace` flag if your namespace is not created yet. + - Execute following command: + ```shell + helm upgrade --install tarantool-app tarantool/cartridge --values ./values.yaml -n my-namespace [--create-namespace] + ``` + +### Useful helm variables + +| JSON Path | Type | Description | +|---------------------------------------------------------------|---------------|-----------------------------------------------| +| dockerconfigjson | array | Docker registry(ies) credentials | +| storageClass | string | An StorageClass name for requested disks | +| tarantool.image.repository | string | Name of application docker image | +| tarantool.image.tag | string | Tag of application docker image | +| tarantool.bucketCount | number | Count of vshard buckets | +| tarantool.memtxMemory | quantity | Size of reserved memtx memory | +| tarantool.auth.user | string | Tarantool super-admin username | +| tarantool.auth.password | string | Tarantool super-admin password/cluster cookie | +| tarantool.roles | array | Roles definition | +| tarantool.roles.*.replicasets | number | Count of replicasets in role | +| tarantool.roles.*.replicas | number | Count of replicas in each replicaset o role | +| tarantool.roles.*.vshard.weight | number | Weight of replicasets in vshard | +| tarantool.roles.*.vshard.roles | array | List of vshard roles | +| tarantool.roles.*.persistence.spec.resources.requests.storage | quantity | Size of disk for each instance of role | diff --git a/docs/development-guide.md b/docs/development-guide.md new file mode 100644 index 00000000..aa2a7e41 --- /dev/null +++ b/docs/development-guide.md @@ -0,0 +1,27 @@ +# Development guide + +**TBD...** + +### Makefile + +Use `make help` to describe all targets. + +Below are some of them. + +### Regenerate the Custom Resource Definitions + +```shell +$ make manifests +``` + +### Building tarantool-operator docker image + +```shell +$ make docker-build +``` + +### Running tests + +```shell +$ make test +``` diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..0a61aec3 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,49 @@ +# Install Tarantool Kubernetes Operator CE + +## Table of Contents + +- [Prerequisites](#prerequisites) +- [Install or Update the Operator using Helm](#install-or-update-the-operator-using-helm) + +## Prerequisites + +- A kubernetes cluster in version ≥1.16, with [dynamic volume provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/) +- [kubectl](https://kubernetes.io/ru/docs/tasks/tools/install-kubectl/) +- [helm](https://helm.sh/docs/intro/install/) + +## Install or update the Operator using Helm + +To install or upgrade the CRD's and the Tarantool Operator using Helm, run following commands from the shell: + +- Add helm repository + + ```shell + helm repo add tarantool https://tarantool.github.io/helm-charts/ + ``` + +- Configure the Operator deployment (optional) + + ```shell + helm show values tarantool/tarantool-operator > operator-values.yaml + ``` + + Edit `operator-values.yaml` file if needed, all parameters described in comments. +- Install/Update operator (choose on of) + - To `default` namespace: + + - Add the `--values ./operator-values.yaml` option if you are using custom configuration of deployment. + - Execute following command: + ```shell + helm upgrade --install tarantool-operator-ce tarantool/tarantool-operator [--values ./operator-values.yaml] + ``` + + - To custom namespace: + + - Replace the `my-namespace` with any name of namespace what you want. + - Add the `--create-namespace` flag if your namespace is not created yet. + - Add the `--values ./operator-values.yaml` option if you are using custom configuration of deployment. + - Execute following command: + ```shell + helm upgrade --install tarantool-operator-ce tarantool/tarantool-operator \ + -n my-namespace [--create-namespace] [--values ./operator-values.yaml] + ``` diff --git a/docs/migrate-from-0.0.x-to-1.0.0.md b/docs/migrate-from-0.0.x-to-1.0.0.md new file mode 100644 index 00000000..3b8d36cd --- /dev/null +++ b/docs/migrate-from-0.0.x-to-1.0.0.md @@ -0,0 +1,181 @@ +# Migration guide from version 0.0.* to version ≥1.0.0-rc1 + +## Disclaimer + +Where is no "kubernetes"-way to upgrade from ~0.0.* to ≥1.0.0-rc1. + +Although this guide provides comprehensive information about the upgrade process, +it will be useful for you to understand the basic concepts of [tarantool cartridge](https://github.com/tarantool/cartridge), [vshard](https://github.com/tarantool/vshard), [kubernetes](https://kubernetes.io/) and [helm](https://helm.sh/). + +All applications built on the tarantool cartridge are unique. It is impossible to know the features of each of them. + +Do not try to blindly follow the instructions, think about your every step and may the Force be with you. + +## Terms + +- `legacy operator` - Tarantool operator in version <1.0.0-rc1 +- `new operator` - Tarantool operator in version ≥1.0.0-rc1 + +## Important + +1. **Read whole guide before start** +2. Be careful with your actions. +3. There is no simple way to rollback +4. Make a whole backup and be ready to restore from it. +5. All cartridge application controlled by legacy operator in your kubernetes cluster MUST be migrated at the same time. +6. It can be helpful if you can change connection address in all application which communicating with your cartridge app. +7. Make sure you have enough resources in your kubernetes cluster + +## Migration process + +1. Find out a namespace of your application +2. Find out a most stable instance* of your application in kubernetes pods and remember pod name + + ```shell + kubectl -n tarantool-app get pod + NAME READY STATUS RESTARTS AGE + routers-0-0 1/1 Running 0 44h + storage-0-0 1/1 Running 0 44h + storage-0-1 1/1 Running 0 44h + ``` + + It seems good to choose vshard-router or any other instance without data. + In this migration guide we will use `routers-0-0` pod. + + * most stable instance - in this context is an instance which usually choose to control your topology, + it can be any instance, but we recommend to choose a vshard-router. + +3. Configure new helm chart for your application using pod name from previous step + + - Replace `tarantool/tarantool-operator-examples-kv` with your docker image name + - Replace `0.0.7` with your docker image tag + + ```yaml + tarantool: + foreignLeader: "routers-0-0" # The name of pod from step 2 - most important field + bucketCount: 30000 # doesn't matter in migration flow + auth: + password: "secret-cluster-cookie" # you should use your actual cluster cookie here + image: + repository: tarantool/tarantool-operator-examples-kv + tag: 0.0.7 + pullPolicy: IfNotPresent + roles: [...] # Your application roles here + ``` + +4. Add helm repository + + ```shell + helm repo add tarantool https://tarantool.github.io/helm-charts/ + ``` + +5. Make sure you are ready to update, at next step you going to lose a way to rollback + - Make sure that all instances of your cartridge app is ready + - Make sure that where are no issues in you cartridge cluster + - Make sure that you have enough free resources in your kubernetes cluster + + Your topology should look like: + + + +6. Manually delete legacy operator (**DO NOT USE HELM**) + + ```shell + kubectl delete ns tarantool-operator + ``` + +7. Install new operator using official helm-chart of new operator + + You can follow [installation guide](./installation.md) at this step + + ```shell + helm upgrade --install tarantool-operator-ce tarantool/tarantool-operator \ + -n tarantool-operator-ce --create-namespace + ``` + + Custom resource definitions will not be updated by helm, you MUST update it manually: + + ```shell + kubectl apply -f https://raw.githubusercontent.com/tarantool/helm-charts/master/charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_cartridgeconfigs.tarantool.io.yaml + kubectl apply -f https://raw.githubusercontent.com/tarantool/helm-charts/master/charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_clusters.tarantool.io.yaml + kubectl apply -f https://raw.githubusercontent.com/tarantool/helm-charts/master/charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_roles.tarantool.io.yaml + ``` + +8. Wait for new operator to be ready + + You can check it by calling next command: + + ```shell + kubectl -n tarantool-operator-ce get deployments.apps + # Operator is ready when its deployment is ready. + # Example NOT ready output + # NAME READY UP-TO-DATE AVAILABLE AGE + # tarantool-operator-ce 0/1 1 0 10s + # Example ready output + # NAME READY UP-TO-DATE AVAILABLE AGE + # tarantool-operator-ce 1/1 1 1 108s + ``` + +9. Install new cartridge helm chart using values file from step 3 + + You can follow [deploy example application guide](./deploy-example-application.md) at this step + + - **Make sure that new helm release have DIFFERENT NAME from old app** + Replace `you-app` with name which you wish in following command. + - **Make sure that new helm release have SAME NAMESPACE as old app** + Replace `your-namespace` with name of namespace where your app was deployed. + - To prevent immediately re-balancing of vshard buckets is **strictly recommend** to set + zero weight for `vshard-storage` roles. + + You can do it by setting `tarantool.roles.*.vshard.weight` param in `values.yaml` + - New cartridge app will be installed into you kubernetes cluster + - Replicasets of new app will join existing cartridge app immediately + + ```shell + helm upgrade --install -n your-namespace you-app tarantool/cartridge --values ./values.yaml + ``` + +10. Wait for all instances of deployed cartridge app to be ready +11. At this step you need to **connect to Cartridge UI on any new instance** using port-forwarding or any other method +12. At this step in Cartridge UI you can see topology similar to following picture: + + + As you can see there are new and old instances joins one cartridge cluster + +13. Manually switch weights on old replicasets and new replicaset to migrate buckets: + + - Choose one of old replicasets + - Remember its weight + - Choose one of new replicasets + - Set remembered weight on it + - Set zero weight on chosen old replicaset + - Wait for to all buckets leaves old replicaset + + Buckets migration can produce lots of internal network traffic, do it step by step. + It's **strictly recommended** to migrate 1 replicaset per time. + +14. You can continue when step 13 completed for all old replicasets +15. Disable and expel all old instance one by one +16. Manually delete all of old resource (DO NOT USE HELM) + + **Be careful with names, in this guide we are using names from legacy docs** + + ```shell + kubectl -n tarantool-app delete clusters.tarantool.io -l tarantool-cluster + kubectl -n tarantool-app delete roles.tarantool.io -l tarantool.io/cluster-id=tarantool-cluster + kubectl -n tarantool-app delete sts -l tarantool.io/cluster-id=tarantool-cluster + kubectl -n tarantool-app delete pod -l tarantool.io/cluster-id=tarantool-cluster + kubectl -n tarantool-app delete svc tarantool-cluster + kubectl -n tarantool-app delete svc routers + kubectl -n tarantool-app delete svc storage + kubectl -n tarantool-app delete secret sh.helm.release.v1.cartridge-app.v1 + ``` + +17. Repeat step 1-3 and 8-15 for each cartridge app in your kubernetes cluster +18. Delete unused CRD + + ```shell + kubectl delete crd replicasettemplates.tarantool.io + ``` + +19. Done, now you are using new operator! diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 132123b1..00000000 --- a/examples/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Tarantool Operator Examples - -[KV storage](./kv) - distributed key value storage - -[Tarantool Data Grid](./tarantool-data-grid) - run TDG on Kubernetes diff --git a/examples/kv/.cartridge.yml b/examples/kv/.cartridge.yml deleted file mode 100644 index b8645893..00000000 --- a/examples/kv/.cartridge.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Here you can specify default parameters for local running, such as: - -# cfg: path-to-cfg-file -# log-dir: path-to-log-dir -# run-dir: path-to-run-dir -# data-dir: path-to-data-dir - -stateboard: false # If no arguments are supplied, --stateboard flag is true diff --git a/examples/kv/.gitignore b/examples/kv/.gitignore deleted file mode 100644 index e6bfc52b..00000000 --- a/examples/kv/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -.rocks -.swo -.swp -CMakeCache.txt -CMakeFiles -cmake_install.cmake -*.dylib -*.idea -__pycache__ -*pyc -.cache -.pytest_cache -.vagrant -.DS_Store -*.xlog -*.snap -*.rpm -*.deb -*.tar.gz -node_modules -/tmp/* -!/tmp/.keep diff --git a/examples/kv/.luacheckrc b/examples/kv/.luacheckrc deleted file mode 100644 index 651afc90..00000000 --- a/examples/kv/.luacheckrc +++ /dev/null @@ -1,4 +0,0 @@ -include_files = {'**/*.lua', '*.luacheckrc', '*.rockspec'} -exclude_files = {'.rocks/', 'tmp/'} -max_line_length = 120 -redefined = false diff --git a/examples/kv/.luacov b/examples/kv/.luacov deleted file mode 100644 index d27ab597..00000000 --- a/examples/kv/.luacov +++ /dev/null @@ -1,6 +0,0 @@ - -statsfile = 'tmp/luacov.stats.out' -reportfile = 'tmp/luacov.report.out' -exclude = { - '/test/', -} diff --git a/examples/kv/Dockerfile.build.cartridge b/examples/kv/Dockerfile.build.cartridge deleted file mode 100644 index b0b8840d..00000000 --- a/examples/kv/Dockerfile.build.cartridge +++ /dev/null @@ -1,13 +0,0 @@ -# Simple Dockerfile -# Used by "pack" command as a base for build image -# when --use-docker option is specified -# -# Image based on centos:7 is expected to be used -FROM centos:7 - -# Here you can install some packages required -# for your application build -# -# RUN set -x \ -# && curl -sL https://rpm.nodesource.com/setup_10.x | bash - \ -# && yum -y install nodejs diff --git a/examples/kv/Dockerfile.cartridge b/examples/kv/Dockerfile.cartridge deleted file mode 100644 index c07cab77..00000000 --- a/examples/kv/Dockerfile.cartridge +++ /dev/null @@ -1,16 +0,0 @@ -# Simple Dockerfile -# Used by "pack docker" command as a base for runtime image -# -# Image based on centos:7 is expected to be used -FROM centos:7 - -# Here you can install some packages required -# for your application in runtime -# -# -# For example, if you need to install some python packages, -# you can do it this way: -# -# COPY requirements.txt /tmp -# RUN yum install -y python3-pip -# RUN pip3 install -r /tmp/requirements.txt diff --git a/examples/kv/README.md b/examples/kv/README.md deleted file mode 100644 index 4abc3eb6..00000000 --- a/examples/kv/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Key Value Storage - -`examples/kv` is a Tarantool-based distributed key value storage. -Data are accessed via HTTP REST API. - -See "Example: key value storage" section in the [main README file](../README.md). diff --git a/examples/kv/app/admin.lua b/examples/kv/app/admin.lua deleted file mode 100644 index 6f98dabe..00000000 --- a/examples/kv/app/admin.lua +++ /dev/null @@ -1,39 +0,0 @@ -local cli_admin = require('cartridge-cli-extensions.admin') - --- register admin function probe to use it with "cartridge admin" -local function init() - cli_admin.init() - - local probe = { - usage = 'Probe instance', - args = { - uri = { - type = 'string', - usage = 'Instance URI', - }, - }, - call = function(opts) - opts = opts or {} - - if opts.uri == nil then - return nil, "Please, pass instance URI via --uri flag" - end - - local cartridge_admin = require('cartridge.admin') - local ok, err = cartridge_admin.probe_server(opts.uri) - - if not ok then - return nil, err.err - end - - return { - string.format('Probe %q: OK', opts.uri), - } - end, - } - - local ok, err = cli_admin.register('probe', probe.usage, probe.args, probe.call) - assert(ok, err) -end - -return {init = init} diff --git a/examples/kv/app/roles/router.lua b/examples/kv/app/roles/router.lua deleted file mode 100644 index 394fed15..00000000 --- a/examples/kv/app/roles/router.lua +++ /dev/null @@ -1,130 +0,0 @@ -local cartridge = require('cartridge') -local router_api = require('app.router.api') - -local function handle_create(req) - local status, body = pcall(function() return req:json() end) - - if type(body) == 'string' then - local resp = req:render{json = { info = msg }} - resp.status = 500 - return resp - end - - if body['key'] == nil then - local resp = req:render{json = { info = msg }} - resp.status = 400 - return resp - end - - if body['value'] == nil then - local resp = req:render{json = { info = msg }} - resp.status = 400 - return resp - end - - local data, err = router_api.create(body['key'], body['value']) - if err ~= nil then - local resp = req:render({json = {error = err}}) - resp.status = 500 - return resp - end - - local resp = req:render({json = data}) - resp.status = 201 - - return resp -end - -local function handle_get(req) - local key = req:stash('key') - local data, err = router_api.get(key) - - if err ~= nil then - local resp = req:render{json = { info = "Key doesn't exist", msg = err and err.msg }} - resp.status = 400 - return resp - end - - return req:render({json = data['value']}) -end - -local function handle_update(req) - local key = req:stash('key') - local _, value = pcall(function() return req:json() end) - - if value == nil then - local resp = req:render{json = { info = "Value cannot be empty" }} - resp.status = 500 - return resp - end - - local data, err = router_api.update(key, value) - if err ~= nil then - local resp = req:render({json = {error = err}}) - resp.status = 500 - return resp - end - - local resp = req:render({json = data}) - resp.status = 201 - - return resp -end - -local function handle_delete(req) - local key = req:stash('key') - - local data, err = router_api.delete(key) - - if err ~= nil then - local resp = req:render{json = { info = "Key doesn't exist", msg = err and err.msg }} - resp.status = 400 - return resp - end - - local resp = req:render{json = { info = "Successfully deleted" }} - resp.status = 200 - return resp -end - -local function init(opts) -- luacheck: no unused args - local httpd = cartridge.service_get('httpd') - if httpd ~= nil then - httpd:route({ path = '/kv/', method = 'POST', public = true }, handle_create) - httpd:route({ path = '/kv/:key', method = 'GET', public = true }, handle_get) - httpd:route({ path = '/kv/:key', method = 'DELETE', public = true }, handle_delete) - httpd:route({ path = '/kv/:key', method = 'PUT ', public = true }, handle_update) - end - - rawset(_G, 'app', {router = {api = router_api}}) - for name, _ in pairs(router_api) do - box.schema.func.create('app.router.api.' .. name, { setuid = true, if_not_exists = true }) - box.schema.user.grant('admin', 'execute', 'function', 'app.router.api.' .. name, { if_not_exists = true }) - end - - return true -end - -local function stop() - return true -end - -local function validate_config(conf_new, conf_old) -- luacheck: no unused args - return true -end - -local function apply_config(conf, opts) -- luacheck: no unused args - -- if opts.is_master then - -- end - - return true -end - -return { - role_name = 'app.roles.router', - init = init, - stop = stop, - validate_config = validate_config, - apply_config = apply_config, - dependencies = {'cartridge.roles.vshard-router'}, -} diff --git a/examples/kv/app/roles/storage.lua b/examples/kv/app/roles/storage.lua deleted file mode 100644 index 88d1a43e..00000000 --- a/examples/kv/app/roles/storage.lua +++ /dev/null @@ -1,53 +0,0 @@ -local cartridge = require('cartridge') -local storage_api = require('app.storage.api') - -local function init(opts) -- luacheck: no unused args - if opts.is_master then - local kv_store = box.schema.space.create( - 'kv_store', - { if_not_exists = true } - ) - - kv_store:format({ - { name = 'key', type = 'string' }, - { name = 'value', type = '*' }, - }) - - kv_store:create_index('primary', - { type = 'hash', parts = {1, 'string'}, if_not_exists = true } - ) - - end - - rawset(_G, 'app', {storage = {api = storage_api}}) - for name, func in pairs(storage_api) do - box.schema.func.create('app.storage.api.' .. name, { setuid = true, if_not_exists = true }) - box.schema.user.grant('admin', 'execute', 'function', 'app.storage.api.' .. name, { if_not_exists = true }) - end - - return true -end - -local function stop() - return true -end - -local function validate_config(conf_new, conf_old) -- luacheck: no unused args - return true -end - -local function apply_config(conf, opts) -- luacheck: no unused args - -- if opts.is_master then - -- end - - return true -end - -return { - role_name = 'app.roles.storage', - init = init, - stop = stop, - validate_config = validate_config, - apply_config = apply_config, - dependencies = {'cartridge.roles.vshard-storage'}, -} diff --git a/examples/kv/app/router/api.lua b/examples/kv/app/router/api.lua deleted file mode 100644 index 2a4acd6c..00000000 --- a/examples/kv/app/router/api.lua +++ /dev/null @@ -1,32 +0,0 @@ -local vshard = require('vshard') - -local function create(key, value) - local bucket_id = vshard.router.bucket_id(key) - local data, err = vshard.router.callrw(bucket_id, 'app.storage.api.insert', { key, value }) - return data, err -end - -local function get(key) - local bucket_id = vshard.router.bucket_id(key) - local data, err = vshard.router.callro(bucket_id, 'app.storage.api.get', { key }) - return data, err -end - -local function update(key, value) - local bucket_id = vshard.router.bucket_id(key) - local data, err = vshard.router.callro(bucket_id, 'app.storage.api.update', { key, value }) - return data, err -end - -local function delete(key) - local bucket_id = vshard.router.bucket_id(key) - local data, err = vshard.router.callrw(bucket_id, 'app.storage.api.delete', { key }) - return data, err -end - -return { - create = create, - get = get, - update = update, - delete = delete, -} diff --git a/examples/kv/app/storage/api.lua b/examples/kv/app/storage/api.lua deleted file mode 100644 index 38e51d4d..00000000 --- a/examples/kv/app/storage/api.lua +++ /dev/null @@ -1,38 +0,0 @@ -local function insert(key, value) - local ok, data = pcall(box.space.kv_store.insert, box.space.kv_store, { key, value }) - if not ok then - return nil, data - end - return data -end - -local function get(key) - local ok, data = pcall(box.space.kv_store.get, box.space.kv_store, key) - if not ok then - return nil, data - end - return data:tomap({ names_only = true }) -end - -local function update(key, value) - local ok, data = pcall(box.space.kv_store.update, box.space.kv_store, { key }, {{ '=', 2, value }}) - if not ok then - return nil, data - end - return data -end - -local function delete(key) - local ok, data = pcall(box.space.kv_store.delete, box.space.kv_store, key) - if not ok then - return nil, data - end - return data -end - -return { - insert = insert, - get = get, - update = update, - delete = delete -} diff --git a/examples/kv/cartridge.post-build b/examples/kv/cartridge.post-build deleted file mode 100755 index 4e03782b..00000000 --- a/examples/kv/cartridge.post-build +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Simple post-build script -# Will be ran after "tarantoolctl rocks make" on application packing -# Could be useful to remove some build artifacts from result package - -# For example: -# rm -rf third_party -# rm -rf node_modules -# rm -rf doc diff --git a/examples/kv/cartridge.pre-build b/examples/kv/cartridge.pre-build deleted file mode 100755 index 0db25c2c..00000000 --- a/examples/kv/cartridge.pre-build +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Simple pre-build script -# Will be ran before "tarantoolctl rocks make" on application build -# Could be useful to install non-standart rocks modules - -# For example: -# tarantoolctl rocks make --chdir ./third_party/my-custom-rock-module diff --git a/examples/kv/deps.sh b/examples/kv/deps.sh deleted file mode 100755 index 705c08c6..00000000 --- a/examples/kv/deps.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# Call this script to install test dependencies - -set -e - -# Test dependencies: -tarantoolctl rocks install luatest 0.5.0 -tarantoolctl rocks install luacov 0.13.0 -tarantoolctl rocks install luacheck 0.25.0 diff --git a/examples/kv/init.lua b/examples/kv/init.lua deleted file mode 100755 index 9bbd32e6..00000000 --- a/examples/kv/init.lua +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env tarantool - -require('strict').on() - --- configure path so that you can run application --- from outside the root directory -if package.setsearchroot ~= nil then - package.setsearchroot() -else - -- Workaround for rocks loading in tarantool 1.10 - -- It can be removed in tarantool > 2.2 - -- By default, when you do require('mymodule'), tarantool looks into - -- the current working directory and whatever is specified in - -- package.path and package.cpath. If you run your app while in the - -- root directory of that app, everything goes fine, but if you try to - -- start your app with "tarantool myapp/init.lua", it will fail to load - -- its modules, and modules from myapp/.rocks. - local fio = require('fio') - local app_dir = fio.abspath(fio.dirname(arg[0])) - package.path = app_dir .. '/?.lua;' .. package.path - package.path = app_dir .. '/?/init.lua;' .. package.path - package.path = app_dir .. '/.rocks/share/tarantool/?.lua;' .. package.path - package.path = app_dir .. '/.rocks/share/tarantool/?/init.lua;' .. package.path - package.cpath = app_dir .. '/?.so;' .. package.cpath - package.cpath = app_dir .. '/?.dylib;' .. package.cpath - package.cpath = app_dir .. '/.rocks/lib/tarantool/?.so;' .. package.cpath - package.cpath = app_dir .. '/.rocks/lib/tarantool/?.dylib;' .. package.cpath -end - --- configure cartridge - -local cartridge = require('cartridge') - -local ok, err = cartridge.cfg({ - roles = { - 'cartridge.roles.vshard-storage', - 'cartridge.roles.vshard-router', - 'cartridge.roles.metrics', - 'app.roles.storage', - 'app.roles.router', - }, -}) - -assert(ok, tostring(err)) - --- register admin function to use it with 'cartridge admin' command - -local admin = require('app.admin') -admin.init() - -local metrics = require('cartridge.roles.metrics') -metrics.set_export({ - { - path = '/metrics', - format = 'prometheus' - }, - { - path = '/health', - format = 'health' - } -}) diff --git a/examples/kv/instances.yml b/examples/kv/instances.yml deleted file mode 100644 index aee4aff3..00000000 --- a/examples/kv/instances.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -kv.router: - advertise_uri: localhost:3301 - http_port: 8081 - -kv.s1-master: - advertise_uri: localhost:3302 - http_port: 8082 - -kv.s1-replica: - advertise_uri: localhost:3303 - http_port: 8083 - -kv.s2-master: - advertise_uri: localhost:3304 - http_port: 8084 - -kv.s2-replica: - advertise_uri: localhost:3305 - http_port: 8085 - -kv-stateboard: - listen: localhost:4401 - password: passwd diff --git a/examples/kv/kv-scm-1.rockspec b/examples/kv/kv-scm-1.rockspec deleted file mode 100644 index 0b585812..00000000 --- a/examples/kv/kv-scm-1.rockspec +++ /dev/null @@ -1,17 +0,0 @@ -package = 'kv' -version = 'scm-1' -source = { - url = '/dev/null', -} --- Put any modules your app depends on here -dependencies = { - 'tarantool', - 'lua >= 5.1', - 'checks == 3.1.0-1', - 'cartridge == 2.7.3-1', - 'metrics == 0.9.0-1', - 'cartridge-cli-extensions == 1.1.1-1', -} -build = { - type = 'none'; -} diff --git a/examples/kv/pack-cache-config.yml b/examples/kv/pack-cache-config.yml deleted file mode 100644 index 673b0c10..00000000 --- a/examples/kv/pack-cache-config.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Specify here paths you want to cache when packaging the application with -# `cartridge pack` command. By default, we propose to cache project rocks. -# See https://github.com/tarantool/cartridge-cli#packing-an-application for details. - -- path: '.rocks' - key-path: kv-scm-1.rockspec diff --git a/examples/kv/package-deps.txt b/examples/kv/package-deps.txt deleted file mode 100644 index ea80d734..00000000 --- a/examples/kv/package-deps.txt +++ /dev/null @@ -1,6 +0,0 @@ -// Empty package dependencies file. -// Used by "pack" command when format is DEB or RPM option is specified. - -// You can specify here dependencies of your package. -// See format of this file in doc: -// https://github.com/tarantool/cartridge-cli#packing-an-application diff --git a/examples/kv/replicasets.yml b/examples/kv/replicasets.yml deleted file mode 100644 index be27f0e1..00000000 --- a/examples/kv/replicasets.yml +++ /dev/null @@ -1,28 +0,0 @@ -router: - instances: - - router - roles: - - failover-coordinator - - vshard-router - - app.roles.router - all_rw: false -s-1: - instances: - - s1-master - - s1-replica - roles: - - vshard-storage - - app.roles.storage - weight: 1 - all_rw: false - vshard_group: default -s-2: - instances: - - s2-master - - s2-replica - roles: - - vshard-storage - - app.roles.storage - weight: 1 - all_rw: false - vshard_group: default diff --git a/examples/kv/test/helper.lua b/examples/kv/test/helper.lua deleted file mode 100644 index 4a0047cb..00000000 --- a/examples/kv/test/helper.lua +++ /dev/null @@ -1,68 +0,0 @@ --- This file is required automatically by luatest. --- Add common configuration here. - -local fio = require('fio') -local t = require('luatest') -local cartridge_helpers = require('cartridge.test-helpers') - -local helper = {} - -helper.root = fio.dirname(fio.abspath(package.search('init'))) -helper.datadir = fio.pathjoin(helper.root, 'tmp', 'db_test') -helper.server_command = fio.pathjoin(helper.root, 'init.lua') - -helper.cluster = cartridge_helpers.Cluster:new({ - server_command = helper.server_command, - datadir = helper.datadir, - use_vshard = false, - replicasets = { - { - alias = 'api', - uuid = cartridge_helpers.uuid('a'), - roles = {'app.roles.custom'}, - servers = { - { instance_uuid = cartridge_helpers.uuid('a', 1), alias = 'api' }, - }, - }, - } -}) - -function helper.truncate_space_on_cluster(cluster, space_name) - assert(cluster ~= nil) - for _, server in ipairs(cluster.servers) do - server.net_box:eval([[ - local space_name = ... - local space = box.space[space_name] - if space ~= nil and not box.cfg.read_only then - space:truncate() - end - ]], {space_name}) - end -end - -function helper.drop_space_on_cluster(cluster, space_name) - assert(cluster ~= nil) - for _, server in ipairs(cluster.servers) do - server.net_box:eval([[ - local space_name = ... - local space = box.space[space_name] - if space ~= nil and not box.cfg.read_only then - space:drop() - end - ]], {space_name}) - end -end - -function helper.stop_cluster(cluster) - assert(cluster ~= nil) - cluster:stop() - fio.rmtree(cluster.datadir) -end - -t.before_suite(function() - fio.rmtree(helper.datadir) - fio.mktree(helper.datadir) - box.cfg({work_dir = helper.datadir}) -end) - -return helper diff --git a/examples/kv/test/integration/api_test.lua b/examples/kv/test/integration/api_test.lua deleted file mode 100644 index e06ff886..00000000 --- a/examples/kv/test/integration/api_test.lua +++ /dev/null @@ -1,32 +0,0 @@ -local t = require('luatest') -local g = t.group('integration_api') - -local helper = require('test.helper') -local cluster = helper.cluster - -g.before_all = function() - g.cluster = helper.cluster - g.cluster:start() -end - -g.after_all = function() - helper.stop_cluster(g.cluster) -end - -g.before_each = function() - -- helper.truncate_space_on_cluster(g.cluster, 'Set your space name here') -end - -g.test_sample = function() - local server = cluster.main_server - local response = server:http_request('post', '/admin/api', {json = {query = '{ cluster { self { alias } } }'}}) - t.assert_equals(response.json, {data = { cluster = { self = { alias = 'api' } } }}) - t.assert_equals(server.net_box:eval('return box.cfg.memtx_dir'), server.workdir) -end - -g.test_metrics = function() - local server = cluster.main_server - local response = server:http_request('get', '/metrics') - t.assert_equals(response.status, 200) - t.assert_equals(response.reason, "Ok") -end diff --git a/examples/kv/test/unit/sample_test.lua b/examples/kv/test/unit/sample_test.lua deleted file mode 100644 index 37c59e86..00000000 --- a/examples/kv/test/unit/sample_test.lua +++ /dev/null @@ -1,12 +0,0 @@ -local t = require('luatest') -local g = t.group('unit_sample') - --- create your space here -g.before_all(function() end) - --- drop your space here -g.after_all(function() end) - -g.test_sample = function() - t.assert_equals(type(box.cfg), 'table') -end diff --git a/examples/kv/tmp/.keep b/examples/kv/tmp/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/tarantool-data-grid/README.md b/examples/tarantool-data-grid/README.md deleted file mode 100644 index 3cd94b5a..00000000 --- a/examples/tarantool-data-grid/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# Tarantool Data Grid - -This folder contains example on how to run [Tarantool Data Grid](https://www.tarantool.io/en/datagrid/) -on Kubernetes. - -## Requirements - -To run this example you will need: - -- [helm](https://helm.sh/docs/intro/install/) -- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -- Tarantool Data Grid docker image - -## Running example - -1. Install Tarantool Helm repo: - - ```shell - $ helm repo add tarantool https://tarantool.github.io/tarantool-operator - ``` - -2. Install Tarantool Kubernetes Operator: - - ```shell - $ helm install --set namespace=tarantool tarantool-operator tarantool/tarantool-operator --namespace tarantool --create-namespace --version 0.0.6 - --- - NAME: tarantool-operator - NAMESPACE: tarantool - STATUS: deployed - TEST SUITE: None - ``` - - wait for Operator to become Running: - - ```shell - $ kubeclt -n tarantool get pods -w - --- - NAME READY STATUS RESTARTS AGE - tarantool-operator-xxx-yyy 1/1 Running 0 3s - ``` - -3. Get Tarantool Data Grid image: - - - go to [tarantool.io](https://tarantool.io) - - - authorize via "Sign In" - - - then go to "Customer zone" > "tdg" - - - download archive with docker image, this example tested on tdg-1.6.8-xxxxxxx.docker-image.tar.gz - - - import image from archive: - - ```shell - $ docker image load -i tdg-1.6.8-xxxxxxx.docker-image.tar.gz - --- - Loaded image ID: sha256:b6206567xxxxxxxxxxxxxx - ``` - - - tag loaded image: - - ```shell - $ docker tag b6206567xxxxxxxxxxxxxx tdg:1.6.8 - ``` - - - make image available to k8s nodes: - - - push image to your registry, so k8s will be able to download it - - - manually upload image to each node - - - -4. Take ```values.yaml``` from this folder, change `image.repository` and `image.tag` to point to tdg image and install it with helm: - - ```shell - $ helm install -f values.yaml tdg-app tarantool/cartridge --namespace tarantool --version 0.0.6 - --- - NAME: tdg-app - NAMESPACE: tarantool - STATUS: deployed - TEST SUITE: None - ``` - -Wait until pods up and cluster is ready. - -5. Access TDG web ui: - - ```shell - kubectl -n tarantool port-forward service/routers 8081:8081 - --- - Forwarding from 127.0.0.1:8081 -> 8081 - Forwarding from [::1]:8081 -> 8081 - ... - ``` - - Now you should be able to navigate to 127.0.0.1:8081 with your browser and access tdg web ui. - -Now you should have running Tarantool Data Grid cluster. - -Proceed to our [TDG examples](https://github.com/tarantool/examples/tree/master/tdg) repository to start using cluster. \ No newline at end of file diff --git a/examples/tarantool-data-grid/values.yaml b/examples/tarantool-data-grid/values.yaml deleted file mode 100644 index ee407ff7..00000000 --- a/examples/tarantool-data-grid/values.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Название среды и название кластера. -ClusterEnv: dev -ClusterName: test-app - -# Docker image to run -image: - repository: tdg - tag: 1.6.8 - pullPolicy: IfNotPresent - -# Cluster topology -RoleConfig: - - RoleName: routers # Tarantool replicaset name - ReplicaCount: 1 # Number of replicas in each replicaset - ReplicaSetCount: 1 # Number of replicasets for this role(s) - DiskSize: 1Gi # Persistent Volume disk sze - CPUallocation: 0.25 # Number of vCPUs to allocate to each container - MemtxMemoryMB: 256 # MB of memory to be assigned to each container - RolesToAssign: # Tarantool Cartridge roles to assign - - account_manager - - input_processor - - connector - - scheduler - - task_runner - - frontend - - notifier - - output_processor - - storage - - logger - - sequence_generator - - failover-coordinator diff --git a/go.mod b/go.mod index 303c666d..230121fe 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,88 @@ module github.com/tarantool/tarantool-operator -go 1.16 +go 1.19 require ( - github.com/google/uuid v1.1.2 // indirect - github.com/machinebox/graphql v0.2.2 // indirect - github.com/onsi/ginkgo v1.16.4 - github.com/onsi/gomega v1.15.0 - github.com/operator-framework/operator-lib v0.9.0 // indirect - k8s.io/api v0.22.3 // indirect - k8s.io/apimachinery v0.22.3 - k8s.io/client-go v0.22.1 - sigs.k8s.io/controller-runtime v0.10.0 + github.com/go-logr/logr v1.2.3 + github.com/google/go-cmp v0.5.8 + github.com/google/uuid v1.1.2 + github.com/onsi/ginkgo v1.16.5 + github.com/onsi/gomega v1.19.0 + github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.7.0 + gopkg.in/yaml.v3 v3.0.1 + k8s.io/api v0.25.0 + k8s.io/apimachinery v0.25.0 + k8s.io/client-go v0.25.0 + sigs.k8s.io/controller-runtime v0.13.1 +) + +require ( + cloud.google.com/go v0.97.0 // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.11.27 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/logger v0.2.1 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/go-logr/zapr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/swag v0.19.14 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.2.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/moby/spdystream v0.2.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nxadm/tail v1.4.8 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.12.2 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.1.1 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect + gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/apiextensions-apiserver v0.25.0 // indirect + k8s.io/component-base v0.25.0 // indirect + k8s.io/klog/v2 v2.70.1 // indirect + k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 509ba90e..221eb8a0 100644 --- a/go.sum +++ b/go.sum @@ -8,47 +8,64 @@ cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0 h1:3ithwDMr7/3vpAMXiH+ZQnYbuIsh+OPhUPMFC9enmn0= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest v0.11.27 h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A= +github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= +github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest/autorest/adal v0.9.20 h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg= +github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= +github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -56,88 +73,52 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= +github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= +github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -148,37 +129,29 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/zapr v0.4.0 h1:uc1uML3hRYL9/ZZPdgHS/n8Nzo+eaYL/Efxkkamf7OM= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= -github.com/goccy/go-yaml v1.8.1/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -189,11 +162,16 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -206,96 +184,74 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -304,156 +260,84 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/machinebox/graphql v0.2.2 h1:dWKpJligYKhYKO5A2gvNhkJdQMNZeChZYyBbrZkBZfo= -github.com/machinebox/graphql v0.2.2/go.mod h1:F+kbVMHuwrQ5tYgU9JXlnskM8nOaFxCAEolaQybkjWA= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/operator-framework/api v0.10.0/go.mod h1:tV0BUNvly7szq28ZPBXhjp1Sqg5yHCOeX19ui9K4vjI= -github.com/operator-framework/operator-lib v0.9.0 h1:Nv1Qk+cRqi5Xm0nxQ4g2ymbiys0fywAYa6KWJMAFudM= -github.com/operator-framework/operator-lib v0.9.0/go.mod h1:2Z32GTTJUz2/f+OKcoJXsVnAyRwcXx7mGmQsdhIAIIE= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -461,69 +345,39 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -546,7 +400,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -556,27 +410,24 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -585,91 +436,121 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 h1:c8PlLMqBbOHoqtjteWm5/kbe6rNY2pbRfbIMVnepueo= -golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -677,37 +558,30 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -722,18 +596,34 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= @@ -746,12 +636,31 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -771,27 +680,71 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -803,29 +756,22 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -837,67 +783,41 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= -k8s.io/api v0.22.1 h1:ISu3tD/jRhYfSW8jI/Q1e+lRxkR7w9UwQEZ7FgslrwY= -k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY= -k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4= -k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs= -k8s.io/apiextensions-apiserver v0.21.1/go.mod h1:KESQFCGjqVcVsZ9g0xX5bacMjyX5emuWcS2arzdEouA= -k8s.io/apiextensions-apiserver v0.22.1 h1:YSJYzlFNFSfUle+yeEXX0lSQyLEoxoPJySRupepb0gE= -k8s.io/apiextensions-apiserver v0.22.1/go.mod h1:HeGmorjtRmRLE+Q8dJu6AYRoZccvCMsghwS8XTUYb2c= -k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/apimachinery v0.22.1 h1:DTARnyzmdHMz7bFWFDDm22AM4pLWTQECMpRTFu2d2OM= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk= -k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apiserver v0.21.1/go.mod h1:nLLYZvMWn35glJ4/FZRhzLG/3MPxAaZTgV4FJZdr+tY= -k8s.io/apiserver v0.22.1/go.mod h1:2mcM6dzSt+XndzVQJX21Gx0/Klo7Aen7i0Ai6tIa400= -k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= -k8s.io/client-go v0.22.1 h1:jW0ZSHi8wW260FvcXHkIa0NLxFBQszTlhiAVsU5mopw= -k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk= -k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= -k8s.io/code-generator v0.22.1/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= -k8s.io/component-base v0.21.1/go.mod h1:NgzFZ2qu4m1juby4TnrmpR8adRk6ka62YdH5DkIIyKA= -k8s.io/component-base v0.22.1 h1:SFqIXsEN3v3Kkr1bS6rstrs1wd45StJqbtgbQ4nRQdo= -k8s.io/component-base v0.22.1/go.mod h1:0D+Bl8rrnsPN9v0dyYvkqFfBeAd4u7n77ze+p8CMiPo= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= +k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= +k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= +k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= +k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= +k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= +k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= +k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= +k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y= +k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210527160623-6fdb442a123b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176 h1:Mx0aa+SUAcNRQbs5jUzV8lkDlGFU8laZsY9jrcVX5SY= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= +k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/controller-runtime v0.9.0/go.mod h1:TgkfvrhhEw3PlI0BRL/5xM+89y3/yc0ZDfdbTl84si8= -sigs.k8s.io/controller-runtime v0.10.0 h1:HgyZmMpjUOrtkaFtCnfxsR1bGRuFoAczSNbn2MoKj5U= -sigs.k8s.io/controller-runtime v0.10.0/go.mod h1:GCdh6kqV6IY4LK0JLwX0Zm6g233RtVGdb/f0+KSfprg= -sigs.k8s.io/controller-tools v0.6.0/go.mod h1:baRMVPrctU77F+rfAuH2uPqW93k6yQnZA2dhUOr7ihc= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= +sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index f6323465..ed148d86 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,27 +1,31 @@ /* -BSD 2-Clause License +Copyright 2022 Tarantool AUTHORS: please see AUTHORS file. -Copyright (c) 2019, Tarantool -All rights reserved. +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY AUTHORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ \ No newline at end of file diff --git a/helm-charts/crud/Chart.yaml b/helm-charts/crud/Chart.yaml deleted file mode 100644 index f8bbdde5..00000000 --- a/helm-charts/crud/Chart.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v2 -appVersion: "1.0" -description: A Helm chart for Tarantool CRUD -name: crud-storage -version: 0.0.1 -dependencies: -- name: tarantool-operator - version: "0.0.7" - repository: "https://tarantool.github.io/tarantool-operator" -- name: cartridge - version: "0.0.7" - repository: "https://tarantool.github.io/tarantool-operator" diff --git a/helm-charts/crud/README.md b/helm-charts/crud/README.md deleted file mode 100644 index 89f0b932..00000000 --- a/helm-charts/crud/README.md +++ /dev/null @@ -1,168 +0,0 @@ -# CRUD base ready-to-use application - -## Chart preparation - -Build chart dependencies - -```shell -$ helm repo add tarantool https://tarantool.github.io/tarantool-operator -$ helm dependency build ./charts/crud/ -``` - -## Deploy - -Run `helm install`: - -```shell -$ helm install crud-app ./charts/crud/ --namespace tarantool --create-namespace ---- -NAME: crud-app -LAST DEPLOYED: Wed Dec 2 15:58:11 2020 -NAMESPACE: tarantool -STATUS: deployed -REVISION: 1 -``` - -Check pods: - -```shell -$ kubectl -n tarantool get pods ---- -NAME READY STATUS RESTARTS AGE -crud-0-0 1/1 Running 0 2m28s -crud-0-1 1/1 Running 0 119s -crud-1-0 1/1 Running 0 2m28s -crud-1-1 1/1 Running 0 2m10s -tarantool-operator-644f487f87-4cqlv 1/1 Running 0 2m31s -``` - -## Schema creation - -Go to Cartridge webUI - -```shell -$ kubectl -n tarantool port-forward crud-0-0 8081:8081 -``` - -Add new migration file `migrations/source/000_bootstrap.lua` on code page and apply configuration: - -![](https://i.imgur.com/6PMZ5Ui.png) - -```lua -return { - up = function() - local utils = require('migrator.utils') - local s = box.schema.create_space('customer', { - format = { - { name = 'id', type = 'number' }, - { name = 'name', type = 'string' }, - { name = 'age', type = 'number' }, - { name = 'bucket_id', type = 'unsigned' }, - }, - if_not_exists = true, - }) - s:create_index('primary', { - parts = { 'id' }, - if_not_exists = true, - }) - s:create_index('bucket_id', { - parts = { 'bucket_id' }, - if_not_exists = true, - unique = false - }) - utils.register_sharding_key('customer', {'bucket_id'}) - return true - end -} -``` - -And apply migration: -```shell -$ curl --header "Content-Type: application/json" \ - --request POST \ - --data '{}' \ - http://localhost:8081/migrations/up ---- -{"applied":["000_bootstrap.lua"]} -``` - -## Using - -Connect to any instance: - -```shell -$ kubectl -n tarantool exec -it crud-0-0 -- /bin/bash -``` -```shell -bash-4.4$ tarantoolctl connect admin:crud-app-cluster-cookie@localhost:3301 -connected to localhost:3301 -``` - -Try insert objects: - -```shell -localhost:3301> crud.insert('customer', {0, "Ivan", 22, box.NULL}) ---- -- metadata: [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}, - {'name': 'age', 'type': 'number'}, {'name': 'bucket_id', 'type': 'unsigned'}] - rows: - - [0, 'Ivan', 22, 18560] -... - -localhost:3301> crud.insert('customer', {1, "Artem", 21, box.NULL}) ---- -- metadata: [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}, - {'name': 'age', 'type': 'number'}, {'name': 'bucket_id', 'type': 'unsigned'}] - rows: - - [1, 'Artem', 21, 12477] -... - -localhost:3301> crud.insert('customer', {2, "Denis", 20, box.NULL}) ---- -- metadata: [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}, - {'name': 'age', 'type': 'number'}, {'name': 'bucket_id', 'type': 'unsigned'}] - rows: - - [2, 'Denis', 20, 21401] -... -``` - -And execute simple select: - -```shell -localhost:3301> crud.select('customer', {{'>=', 'age', 21}}) ---- -- metadata: [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}, - {'name': 'age', 'type': 'number'}, {'name': 'bucket_id', 'type': 'unsigned'}] - rows: - - [0, 'Ivan', 22, 18560] - - [1, 'Artem', 21, 12477] -... -``` - -## Customization - -By default the cluster contains two replicasets of two nodes (master - replica). If you want to change this configuration, you must describe it in the file `crud_values.yaml` - -For example: -```yaml -cartridge: - RoleConfig: - - RoleName: crud - ReplicaCount: 2 - ReplicaSetCount: 5 - DiskSize: 1Gi - CPUallocation: 0.25 - MemtxMemoryMB: 256 - RolesToAssign: - - crud-storage - - crud-router - - migrator - - metrics -``` -And pass this values to `helm install`: - -```shell -$ helm install crud-app -f crud_values.yaml ./charts/crud/ --namespace tarantool --create-namespace -``` - -**NOTE** - all specified fields are required. Look at [this](https://github.com/tarantool/tarantool-operator/issues/44) ticket. \ No newline at end of file diff --git a/helm-charts/crud/crud-app/Dockerfile.build.cartridge b/helm-charts/crud/crud-app/Dockerfile.build.cartridge deleted file mode 100644 index 3ebf158c..00000000 --- a/helm-charts/crud/crud-app/Dockerfile.build.cartridge +++ /dev/null @@ -1,13 +0,0 @@ -# Simple Dockerfile -# Used by "pack" command as a base for build image -# when --use-docker option is specified -# -# The base image must be centos:8 -FROM centos:8 - -# Here you can install some packages required -# for your application build -# -# RUN set -x \ -# && curl -sL https://rpm.nodesource.com/setup_10.x | bash - \ -# && yum -y install nodejs diff --git a/helm-charts/crud/crud-app/Dockerfile.cartridge b/helm-charts/crud/crud-app/Dockerfile.cartridge deleted file mode 100644 index e44e307d..00000000 --- a/helm-charts/crud/crud-app/Dockerfile.cartridge +++ /dev/null @@ -1,16 +0,0 @@ -# Simple Dockerfile -# Used by "pack docker" command as a base for runtime image -# -# The base image must be centos:8 -FROM centos:8 - -# Here you can install some packages required -# for your application in runtime -# -# -# For example, if you need to install some python packages, -# you can do it this way: -# -# COPY requirements.txt /tmp -# RUN yum install -y python3-pip -# RUN pip3 install -r /tmp/requirements.txt diff --git a/helm-charts/crud/crud-app/cartridge.post-build b/helm-charts/crud/crud-app/cartridge.post-build deleted file mode 100755 index 4e03782b..00000000 --- a/helm-charts/crud/crud-app/cartridge.post-build +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Simple post-build script -# Will be ran after "tarantoolctl rocks make" on application packing -# Could be useful to remove some build artifacts from result package - -# For example: -# rm -rf third_party -# rm -rf node_modules -# rm -rf doc diff --git a/helm-charts/crud/crud-app/cartridge.pre-build b/helm-charts/crud/crud-app/cartridge.pre-build deleted file mode 100755 index 0db25c2c..00000000 --- a/helm-charts/crud/crud-app/cartridge.pre-build +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Simple pre-build script -# Will be ran before "tarantoolctl rocks make" on application build -# Could be useful to install non-standart rocks modules - -# For example: -# tarantoolctl rocks make --chdir ./third_party/my-custom-rock-module diff --git a/helm-charts/crud/crud-app/crud-app-scm-1.rockspec b/helm-charts/crud/crud-app/crud-app-scm-1.rockspec deleted file mode 100644 index 3121f92c..00000000 --- a/helm-charts/crud/crud-app/crud-app-scm-1.rockspec +++ /dev/null @@ -1,18 +0,0 @@ -package = 'crud-app' -version = 'scm-1' -source = { - url = '/dev/null', -} --- Put any modules your app depends on here -dependencies = { - 'tarantool', - 'lua >= 5.1', - 'checks == 3.0.1-1', - 'cartridge == 2.7.3-1', - 'metrics == 0.5.0-1', - 'crud >= 0.1.0-1', - 'migrations == 0.3.1-1', -} -build = { - type = 'none'; -} diff --git a/helm-charts/crud/crud-app/deps.sh b/helm-charts/crud/crud-app/deps.sh deleted file mode 100755 index 705c08c6..00000000 --- a/helm-charts/crud/crud-app/deps.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# Call this script to install test dependencies - -set -e - -# Test dependencies: -tarantoolctl rocks install luatest 0.5.0 -tarantoolctl rocks install luacov 0.13.0 -tarantoolctl rocks install luacheck 0.25.0 diff --git a/helm-charts/crud/crud-app/init.lua b/helm-charts/crud/crud-app/init.lua deleted file mode 100755 index f7277b00..00000000 --- a/helm-charts/crud/crud-app/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env tarantool - -require('strict').on() - -if package.setsearchroot ~= nil then - package.setsearchroot() -else - -- Workaround for rocks loading in tarantool 1.10 - -- It can be removed in tarantool > 2.2 - -- By default, when you do require('mymodule'), tarantool looks into - -- the current working directory and whatever is specified in - -- package.path and package.cpath. If you run your app while in the - -- root directory of that app, everything goes fine, but if you try to - -- start your app with "tarantool myapp/init.lua", it will fail to load - -- its modules, and modules from myapp/.rocks. - local fio = require('fio') - local app_dir = fio.abspath(fio.dirname(arg[0])) - print('App dir set to ' .. app_dir) - package.path = app_dir .. '/?.lua;' .. package.path - package.path = app_dir .. '/?/init.lua;' .. package.path - package.path = app_dir .. '/.rocks/share/tarantool/?.lua;' .. package.path - package.path = app_dir .. '/.rocks/share/tarantool/?/init.lua;' .. package.path - package.cpath = app_dir .. '/?.so;' .. package.cpath - package.cpath = app_dir .. '/?.dylib;' .. package.cpath - package.cpath = app_dir .. '/.rocks/lib/tarantool/?.so;' .. package.cpath - package.cpath = app_dir .. '/.rocks/lib/tarantool/?.dylib;' .. package.cpath -end - -local cartridge = require('cartridge') - -local ok, err = cartridge.cfg({ - roles = { - 'cartridge.roles.vshard-storage', - 'cartridge.roles.vshard-router', - 'cartridge.roles.metrics', - 'cartridge.roles.crud-router', - 'cartridge.roles.crud-storage', - 'migrator', - }, - cluster_cookie = 'crud-app-cluster-cookie', -}) - -assert(ok, tostring(err)) - -local migrator = require('migrator') -migrator.set_loader(require('migrator.config-loader').new()) diff --git a/helm-charts/crud/crud-app/instances.yml b/helm-charts/crud/crud-app/instances.yml deleted file mode 100644 index 6b7c6029..00000000 --- a/helm-charts/crud/crud-app/instances.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -crud-app.router: - advertise_uri: localhost:3301 - http_port: 8081 - -crud-app.s1-master: - advertise_uri: localhost:3302 - http_port: 8082 - -crud-app.s1-replica: - advertise_uri: localhost:3303 - http_port: 8083 - -crud-app.s2-master: - advertise_uri: localhost:3304 - http_port: 8084 - -crud-app.s2-replica: - advertise_uri: localhost:3305 - http_port: 8085 diff --git a/helm-charts/crud/crud-app/test/helper.lua b/helm-charts/crud/crud-app/test/helper.lua deleted file mode 100644 index c1b46f4b..00000000 --- a/helm-charts/crud/crud-app/test/helper.lua +++ /dev/null @@ -1,18 +0,0 @@ --- This file is required automatically by luatest. --- Add common configuration here. - -local fio = require('fio') -local t = require('luatest') - -local helper = {} - -helper.root = fio.dirname(fio.abspath(package.search('init'))) -helper.datadir = fio.pathjoin(helper.root, 'tmp', 'db_test') -helper.server_command = fio.pathjoin(helper.root, 'init.lua') - -t.before_suite(function() - fio.rmtree(helper.datadir) - fio.mktree(helper.datadir) -end) - -return helper diff --git a/helm-charts/crud/crud-app/test/helper/integration.lua b/helm-charts/crud/crud-app/test/helper/integration.lua deleted file mode 100644 index f5198e19..00000000 --- a/helm-charts/crud/crud-app/test/helper/integration.lua +++ /dev/null @@ -1,27 +0,0 @@ -local t = require('luatest') - -local cartridge_helpers = require('cartridge.test-helpers') -local shared = require('test.helper') - -local helper = {shared = shared} - -helper.cluster = cartridge_helpers.Cluster:new({ - server_command = shared.server_command, - datadir = shared.datadir, - use_vshard = false, - replicasets = { - { - alias = 'api', - uuid = cartridge_helpers.uuid('a'), - roles = {'app.roles.custom'}, - servers = { - { instance_uuid = cartridge_helpers.uuid('a', 1) } - }, - }, - }, -}) - -t.before_suite(function() helper.cluster:start() end) -t.after_suite(function() helper.cluster:stop() end) - -return helper diff --git a/helm-charts/crud/crud-app/test/helper/unit.lua b/helm-charts/crud/crud-app/test/helper/unit.lua deleted file mode 100644 index dcaefa9b..00000000 --- a/helm-charts/crud/crud-app/test/helper/unit.lua +++ /dev/null @@ -1,9 +0,0 @@ -local t = require('luatest') - -local shared = require('test.helper') - -local helper = {shared = shared} - -t.before_suite(function() box.cfg({work_dir = shared.datadir}) end) - -return helper diff --git a/helm-charts/crud/crud-app/test/integration/api_test.lua b/helm-charts/crud/crud-app/test/integration/api_test.lua deleted file mode 100644 index 5f14cd28..00000000 --- a/helm-charts/crud/crud-app/test/integration/api_test.lua +++ /dev/null @@ -1,12 +0,0 @@ -local t = require('luatest') -local g = t.group('integration_api') - -local helper = require('test.helper.integration') -local cluster = helper.cluster - -g.test_sample = function() - local server = cluster.main_server - local response = server:http_request('post', '/admin/api', {json = {query = '{}'}}) - t.assert_equals(response.json, {data = {}}) - t.assert_equals(server.net_box:eval('return box.cfg.memtx_dir'), server.workdir) -end diff --git a/helm-charts/crud/crud-app/test/unit/sample_test.lua b/helm-charts/crud/crud-app/test/unit/sample_test.lua deleted file mode 100644 index 790cf5cc..00000000 --- a/helm-charts/crud/crud-app/test/unit/sample_test.lua +++ /dev/null @@ -1,8 +0,0 @@ -local t = require('luatest') -local g = t.group('unit_sample') - -require('test.helper.unit') - -g.test_sample = function() - t.assert_equals(type(box.cfg), 'table') -end diff --git a/helm-charts/crud/requirements.lock b/helm-charts/crud/requirements.lock deleted file mode 100644 index 8401e0f2..00000000 --- a/helm-charts/crud/requirements.lock +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: -- name: tarantool-operator - repository: https://tarantool.github.io/tarantool-operator - version: 0.0.7 -- name: cartridge - repository: https://tarantool.github.io/tarantool-operator - version: 0.0.7 -digest: sha256:1d9a2af9e20c9b635a433af6d5bb5637473ae8a81eeb8a27252e21e0d4695aca -generated: "2020-12-01T21:22:55.751256666+03:00" diff --git a/helm-charts/crud/values.yaml b/helm-charts/crud/values.yaml deleted file mode 100644 index 9ed5d604..00000000 --- a/helm-charts/crud/values.yaml +++ /dev/null @@ -1,31 +0,0 @@ - -# Set default values for cartridge dependency -cartridge: - ClusterEnv: dev - ClusterName: crud-app - - image: - repository: tarantool/crud-app - tag: 0.1.0 - pullPolicy: IfNotPresent - - service: - type: ClusterIP - port: 8081 - - Prometheus: - port: 8081 - path: /metrics - - RoleConfig: - - RoleName: crud - ReplicaCount: 2 - ReplicaSetCount: 2 - DiskSize: 1Gi - CPUallocation: 0.25 - MemtxMemoryMB: 256 - RolesToAssign: - - crud-storage - - crud-router - - migrator - - metrics diff --git a/helm-charts/tarantool-cartridge/Chart.yaml b/helm-charts/tarantool-cartridge/Chart.yaml deleted file mode 100644 index fc35ed0c..00000000 --- a/helm-charts/tarantool-cartridge/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for tarantool -name: cartridge -version: 0.0.11 diff --git a/helm-charts/tarantool-cartridge/templates/_helpers.tpl b/helm-charts/tarantool-cartridge/templates/_helpers.tpl deleted file mode 100644 index e79ca1ff..00000000 --- a/helm-charts/tarantool-cartridge/templates/_helpers.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "tarantool.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "tarantool.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "tarantool.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "tarantool.labels" -}} -app.kubernetes.io/name: {{ include "tarantool.name" . }} -helm.sh/chart: {{ include "tarantool.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} diff --git a/helm-charts/tarantool-cartridge/templates/deployment.yaml b/helm-charts/tarantool-cartridge/templates/deployment.yaml deleted file mode 100644 index d2d8b1f2..00000000 --- a/helm-charts/tarantool-cartridge/templates/deployment.yaml +++ /dev/null @@ -1,146 +0,0 @@ -apiVersion: tarantool.io/v1alpha1 -kind: Cluster -metadata: - name: {{ .Values.ClusterName }} -spec: - selector: - matchLabels: - tarantool.io/cluster-id: {{ .Values.ClusterName }} ---- -{{- range .Values.RoleConfig }} -{{- $r := .RolesToAssign | toJson | quote }} -apiVersion: tarantool.io/v1alpha1 -kind: Role -metadata: - name: {{ .RoleName | replace "_" "" }} - labels: - tarantool.io/cluster-id: {{ $.Values.ClusterName }} - tarantool.io/role: {{ .RoleName }} - annotations: - tarantool.io/rolesToAssign: {{ $r }} -spec: - selector: - matchLabels: - tarantool.io/replicaset-template: "{{ .RoleName }}-template" - numReplicasets: {{ .ReplicaSetCount }} ---- -apiVersion: tarantool.io/v1alpha1 -kind: ReplicasetTemplate -metadata: - name: "{{ .RoleName | replace "_" "" }}-template" - labels: - tarantool.io/cluster-id: {{ $.Values.ClusterName }} - tarantool.io/replicaset-template: "{{ .RoleName }}-template" - tarantool.io/role: {{ .RoleName }} - tarantool.io/useVshardGroups: "0" - annotations: - tarantool.io/rolesToAssign: {{ $r }} -spec: - replicas: {{ .ReplicaCount }} - serviceName: {{ .RoleName }} - selector: - matchLabels: - tarantool.io/pod-template: "{{ .RoleName }}-pod-template" - volumeClaimTemplates: - - metadata: - name: www - spec: - accessModes: ["ReadWriteOnce"] - resources: - requests: - storage: {{ .DiskSize }} - template: - metadata: - labels: - tarantool.io/cluster-id: "{{ $.Values.ClusterName }}" - tarantool.io/cluster-domain-name: "{{ $.Values.ClusterDomainName }}" - tarantool.io/pod-template: "{{ .RoleName }}-pod-template" - tarantool.io/useVshardGroups: "0" - annotations: - tarantool.io/rolesToAssign: {{ $r }} - prometheus.io/path: "{{ $.Values.Prometheus.path }}" - prometheus.io/port: "{{ $.Values.Prometheus.port}}" - prometheus.io/scrape: "true" - spec: - terminationGracePeriodSeconds: 10 - dnsConfig: - options: - - name: ndots - value: "1" - securityContext: - fsGroup: {{ $.Values.securityContext.fsGroup }} - containers: - - name: pim-storage - image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}" - volumeMounts: - - name: www - mountPath: "{{ $.Values.TarantoolWorkDir }}" - resources: - requests: - cpu: "{{ .CPUallocation }}" - memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M" - limits: - cpu: "{{ .CPUallocation }}" - memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M" - ports: - - containerPort: 3301 - protocol: TCP - name: app - - containerPort: 3301 - protocol: UDP - name: app-udp - - containerPort: 8081 - protocol: TCP - name: http - env: - - name: ENVIRONMENT - value: "{{ $.Values.ClusterEnv }}" - - name: TARANTOOL_INSTANCE_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: TARANTOOL_ALIAS - value: "$(TARANTOOL_INSTANCE_NAME)" - - name: TARANTOOL_MEMTX_MEMORY - value: "{{ mul .MemtxMemoryMB 1048576 }}" - - name: TARANTOOL_BUCKET_COUNT - value: "30000" - - name: TARANTOOL_WORKDIR - value: "{{ $.Values.TarantoolWorkDir }}" - - name: TARANTOOL_ADVERTISE_TMP - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: TARANTOOL_ADVERTISE_HOST - value: "$(TARANTOOL_ADVERTISE_TMP).{{ $.Values.ClusterName }}.{{ $.Release.Namespace }}.svc.{{ $.Values.ClusterDomainName }}" - - name: TARANTOOL_ADVERTISE_URI - value: "$(TARANTOOL_ADVERTISE_HOST):3301" - - name: TARANTOOL_PROBE_URI_TIMEOUT - value: "60" - - name: TARANTOOL_HTTP_PORT - value: "8081" - readinessProbe: - tcpSocket: - port: http - initialDelaySeconds: 15 - periodSeconds: 10 ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .RoleName }} - labels: - tarantool.io/role: {{ .RoleName }} -spec: - ports: - - port: 8081 - name: web - protocol: TCP - - port: 3301 - name: app - protocol: TCP - selector: - tarantool.io/role: {{ .RoleName }} ---- -{{- end }} ---- diff --git a/helm-charts/tarantool-cartridge/templates/tests/test-connection.yaml b/helm-charts/tarantool-cartridge/templates/tests/test-connection.yaml deleted file mode 100644 index 1e552c68..00000000 --- a/helm-charts/tarantool-cartridge/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -{{- range .Values.RoleConfig }} -apiVersion: v1 -kind: Pod -metadata: - name: "{{.RoleName}}-test-connection" - annotations: - helm.sh/hook: test-success - helm.sh/hook-delete-policy: hook-succeeded -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ["{{.RoleName}}:{{ $.Values.service.port }}"] - restartPolicy: Never ---- -{{- end }} diff --git a/helm-charts/tarantool-cartridge/values.yaml b/helm-charts/tarantool-cartridge/values.yaml deleted file mode 100644 index 0b074fe1..00000000 --- a/helm-charts/tarantool-cartridge/values.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Declare variables to be passed into your templates. - -ClusterEnv: dev -ClusterName: tarantool-cluster -ClusterDomainName: cluster.local -TarantoolWorkDir: /var/lib/tarantool -LuaMemoryReserveMB: 2048 - -image: - repository: tarantool/tarantool-operator-examples-kv - tag: 0.0.4 - pullPolicy: IfNotPresent - -securityContext: - fsGroup: 1200 - -service: - type: ClusterIP - port: 8081 - -Prometheus: - port: 8081 - path: /metrics - -RoleConfig: - - RoleName: routers # ReplicaSet name - ReplicaCount: 1 # Number of replicas in each ReplicaSet - ReplicaSetCount: 1 # Number of ReplicaSets for this role(s) - DiskSize: 1Gi # Persistent Volume disk sze - CPUallocation: 0.25 # Number of vCPUs to allocate to each container - MemtxMemoryMB: 256 # MB of memory to be assigned to each container - RolesToAssign: - - app.roles.router - - - RoleName: storage - ReplicaCount: 2 - ReplicaSetCount: 1 - DiskSize: 1Gi - CPUallocation: 0.25 - MemtxMemoryMB: 256 - RolesToAssign: - - app.roles.storage diff --git a/helm-charts/tarantool-operator/.helmignore b/helm-charts/tarantool-operator/.helmignore deleted file mode 100644 index 5f37c557..00000000 --- a/helm-charts/tarantool-operator/.helmignore +++ /dev/null @@ -1,29 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ -# ignore the custom resource examples -templates/crds/tarantool_*cr.yaml -# Ignore plural definitions, not required -templates/crds/tarantool.io_replicasettemplates_crd.yaml -templates/crds/tarantool.io_roles_crd.yaml -templates/crds/tarantool.io_clusters_crd.yaml diff --git a/helm-charts/tarantool-operator/Chart.yaml b/helm-charts/tarantool-operator/Chart.yaml deleted file mode 100644 index e84930b5..00000000 --- a/helm-charts/tarantool-operator/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v2 -name: tarantool-operator -description: kubernetes tarantool operator - -type: application - -# Helm chart Version -version: 0.0.11 - -# Application version to be deployed -appVersion: 1.16.0 diff --git a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_clusters.tarantool.io.yaml b/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_clusters.tarantool.io.yaml deleted file mode 100644 index bca1b143..00000000 --- a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_clusters.tarantool.io.yaml +++ /dev/null @@ -1,88 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.7.0 - creationTimestamp: null - name: clusters.tarantool.io -spec: - group: tarantool.io - names: - kind: Cluster - listKind: ClusterList - plural: clusters - singular: cluster - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.state - name: State - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Cluster is the Schema for the clusters API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ClusterSpec defines the desired state of Cluster - properties: - selector: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - type: object - status: - description: ClusterStatus defines the observed state of Cluster - properties: - state: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_replicasettemplates.tarantool.io.yaml b/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_replicasettemplates.tarantool.io.yaml deleted file mode 100644 index 5ac29cd0..00000000 --- a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_replicasettemplates.tarantool.io.yaml +++ /dev/null @@ -1,4255 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.7.0 - creationTimestamp: null - name: replicasettemplates.tarantool.io -spec: - group: tarantool.io - names: - kind: ReplicasetTemplate - listKind: ReplicasetTemplateList - plural: replicasettemplates - singular: replicasettemplate - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ReplicasetTemplate is the Schema for the replicasettemplates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: A StatefulSetSpec is the specification of a StatefulSet. - properties: - minReadySeconds: - description: Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. - format: int32 - type: integer - podManagementPolicy: - description: podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once. - type: string - replicas: - description: 'replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. TODO: Consider a rename of this field.' - format: int32 - type: integer - revisionHistoryLimit: - description: revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - format: int32 - type: integer - selector: - description: 'selector is a label query over pods that should match the replica count. It must match the pod template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - serviceName: - description: 'serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller.' - type: string - template: - description: template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: 'Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' - properties: - activeDeadlineSeconds: - description: Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer. - format: int64 - type: integer - affinity: - description: If specified, the pod's scheduling constraints - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. - items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - automountServiceAccountToken: - description: AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. - type: boolean - containers: - description: List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. - items: - description: A single application container that you want to run within a pod. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - dnsConfig: - description: Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. - properties: - nameservers: - description: A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. - items: - type: string - type: array - options: - description: A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy. - items: - description: PodDNSConfigOption defines DNS resolver options of a pod. - properties: - name: - description: Required. - type: string - value: - type: string - type: object - type: array - searches: - description: A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. - items: - type: string - type: array - type: object - dnsPolicy: - description: Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. - type: string - enableServiceLinks: - description: 'EnableServiceLinks indicates whether information about services should be injected into pod''s environment variables, matching the syntax of Docker links. Optional: Defaults to true.' - type: boolean - ephemeralContainers: - description: List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. - items: - description: An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Lifecycle is not allowed for ephemeral containers. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers. - type: string - ports: - description: Ports are not allowed for ephemeral containers. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - readinessProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - targetContainerName: - description: If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature. - type: string - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - hostAliases: - description: HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. - items: - description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. - properties: - hostnames: - description: Hostnames for the above IP address. - items: - type: string - type: array - ip: - description: IP address of the host file entry. - type: string - type: object - type: array - hostIPC: - description: 'Use the host''s ipc namespace. Optional: Default to false.' - type: boolean - hostNetwork: - description: Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false. - type: boolean - hostPID: - description: 'Use the host''s pid namespace. Optional: Default to false.' - type: boolean - hostname: - description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. - type: string - imagePullSecrets: - description: 'ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - items: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - type: array - initContainers: - description: 'List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' - items: - description: A single application container that you want to run within a pod. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - nodeName: - description: NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. - type: string - nodeSelector: - additionalProperties: - type: string - description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' - type: object - x-kubernetes-map-type: atomic - overhead: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.' - type: object - preemptionPolicy: - description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate. - type: string - priority: - description: The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. - format: int32 - type: integer - priorityClassName: - description: If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. - type: string - readinessGates: - description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' - items: - description: PodReadinessGate contains the reference to a pod condition - properties: - conditionType: - description: ConditionType refers to a condition in the pod's condition list with matching type. - type: string - required: - - conditionType - type: object - type: array - restartPolicy: - description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' - type: string - runtimeClassName: - description: 'RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.' - type: string - schedulerName: - description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. - type: string - securityContext: - description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.' - properties: - fsGroup: - description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any volume." - format: int64 - type: integer - fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.' - type: string - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by the containers in this pod. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - supplementalGroups: - description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. - items: - format: int64 - type: integer - type: array - sysctls: - description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. - items: - description: Sysctl defines a kernel parameter to be set - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - serviceAccount: - description: 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.' - type: string - serviceAccountName: - description: 'ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' - type: string - setHostnameAsFQDN: - description: If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. - type: boolean - shareProcessNamespace: - description: 'Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.' - type: boolean - subdomain: - description: If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. - type: string - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. - format: int64 - type: integer - tolerations: - description: If specified, the pod's tolerations. - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - type: array - topologySpreadConstraints: - description: TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. - items: - description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. - properties: - labelSelector: - description: LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - maxSkew: - description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' - format: int32 - type: integer - topologyKey: - description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try to put balanced number of pods into each bucket. It's a required field. - type: string - whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a pod if it doesn''t satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assigment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won''t make it *more* imbalanced. It''s a required field.' - type: string - required: - - maxSkew - - topologyKey - - whenUnsatisfiable - type: object - type: array - x-kubernetes-list-map-keys: - - topologyKey - - whenUnsatisfiable - x-kubernetes-list-type: map - volumes: - description: 'List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' - items: - description: Volume represents a named volume in a pod that may be accessed by any container in the pod. - properties: - awsElasticBlockStore: - description: 'AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' - format: int32 - type: integer - readOnly: - description: 'Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: boolean - volumeID: - description: 'Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: string - required: - - volumeID - type: object - azureDisk: - description: AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - properties: - cachingMode: - description: 'Host Caching mode: None, Read Only, Read Write.' - type: string - diskName: - description: The Name of the data disk in the blob storage - type: string - diskURI: - description: The URI the data disk in the blob storage - type: string - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - kind: - description: 'Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - description: AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - properties: - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretName: - description: the name of secret that contains Azure Storage Account Name and Key - type: string - shareName: - description: Share Name - type: string - required: - - secretName - - shareName - type: object - cephfs: - description: CephFS represents a Ceph FS mount on the host that shares a pod's lifetime - properties: - monitors: - description: 'Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - items: - type: string - type: array - path: - description: 'Optional: Used as the mounted root, rather than the full Ceph tree, default is /' - type: string - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: boolean - secretFile: - description: 'Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - secretRef: - description: 'Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - user: - description: 'Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - required: - - monitors - type: object - cinder: - description: 'Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - properties: - fsType: - description: 'Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: boolean - secretRef: - description: 'Optional: points to a secret object containing parameters used to connect to OpenStack.' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - volumeID: - description: 'volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - required: - - volumeID - type: object - configMap: - description: ConfigMap represents a configMap that should populate this volume - properties: - defaultMode: - description: 'Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its keys must be defined - type: boolean - type: object - csi: - description: CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - properties: - driver: - description: Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - type: string - fsType: - description: Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - type: string - nodePublishSecretRef: - description: NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - readOnly: - description: Specifies a read-only configuration for the volume. Defaults to false (read/write). - type: boolean - volumeAttributes: - additionalProperties: - type: string - description: VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - type: object - required: - - driver - type: object - downwardAPI: - description: DownwardAPI represents downward API about the pod that should populate this volume - properties: - defaultMode: - description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: Items is a list of downward API volume file - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - description: 'EmptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - properties: - medium: - description: 'What type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - description: 'Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - description: "Ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time. \n This is a beta feature and only available when the GenericEphemeralVolume feature gate is enabled." - properties: - volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." - properties: - metadata: - description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. - properties: - accessModes: - description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - dataSource: - description: 'This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: 'Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - resources: - description: 'Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - selector: - description: A label query over volumes to consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - storageClassName: - description: 'Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: VolumeName is the binding reference to the PersistentVolume backing this claim. - type: string - type: object - required: - - spec - type: object - type: object - fc: - description: FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - properties: - fsType: - description: 'Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - lun: - description: 'Optional: FC target lun number' - format: int32 - type: integer - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - targetWWNs: - description: 'Optional: FC target worldwide names (WWNs)' - items: - type: string - type: array - wwids: - description: 'Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' - items: - type: string - type: array - type: object - flexVolume: - description: FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - properties: - driver: - description: Driver is the name of the driver to use for this volume. - type: string - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - type: string - options: - additionalProperties: - type: string - description: 'Optional: Extra command options if any.' - type: object - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - secretRef: - description: 'Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - required: - - driver - type: object - flocker: - description: Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - properties: - datasetName: - description: Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - type: string - datasetUUID: - description: UUID of the dataset. This is unique identifier of a Flocker dataset - type: string - type: object - gcePersistentDisk: - description: 'GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - format: int32 - type: integer - pdName: - description: 'Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: string - readOnly: - description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: boolean - required: - - pdName - type: object - gitRepo: - description: 'GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' - properties: - directory: - description: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - type: string - repository: - description: Repository URL - type: string - revision: - description: Commit hash for the specified revision. - type: string - required: - - repository - type: object - glusterfs: - description: 'Glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' - properties: - endpoints: - description: 'EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - path: - description: 'Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - readOnly: - description: 'ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: boolean - required: - - endpoints - - path - type: object - hostPath: - description: 'HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' - properties: - path: - description: 'Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - type: - description: 'Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - required: - - path - type: object - iscsi: - description: 'ISCSI represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' - properties: - chapAuthDiscovery: - description: whether support iSCSI Discovery CHAP authentication - type: boolean - chapAuthSession: - description: whether support iSCSI Session CHAP authentication - type: boolean - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - initiatorName: - description: Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. - type: string - iqn: - description: Target iSCSI Qualified Name. - type: string - iscsiInterface: - description: iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - type: string - lun: - description: iSCSI Target Lun number. - format: int32 - type: integer - portals: - description: iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - items: - type: string - type: array - readOnly: - description: ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - type: boolean - secretRef: - description: CHAP Secret for iSCSI target and initiator authentication - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - targetPortal: - description: iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - description: 'Volume''s name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - nfs: - description: 'NFS represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - properties: - path: - description: 'Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - readOnly: - description: 'ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: boolean - server: - description: 'Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - description: 'PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - claimName: - description: 'ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: string - readOnly: - description: Will force the ReadOnly setting in VolumeMounts. Default false. - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - description: PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - pdID: - description: ID that identifies Photon Controller persistent disk - type: string - required: - - pdID - type: object - portworxVolume: - description: PortworxVolume represents a portworx volume attached and mounted on kubelets host machine - properties: - fsType: - description: FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - volumeID: - description: VolumeID uniquely identifies a Portworx volume - type: string - required: - - volumeID - type: object - projected: - description: Items for all in one resources secrets, configmaps, and downward API - properties: - defaultMode: - description: Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - format: int32 - type: integer - sources: - description: list of volume projections - items: - description: Projection that may be projected along with other supported volume types - properties: - configMap: - description: information about the configMap data to project - properties: - items: - description: If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its keys must be defined - type: boolean - type: object - downwardAPI: - description: information about the downwardAPI data to project - properties: - items: - description: Items is a list of DownwardAPIVolume file - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - description: information about the secret data to project - properties: - items: - description: If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - type: object - serviceAccountToken: - description: information about the serviceAccountToken data to project - properties: - audience: - description: Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. - type: string - expirationSeconds: - description: ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - format: int64 - type: integer - path: - description: Path is the path relative to the mount point of the file to project the token into. - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - description: Quobyte represents a Quobyte mount on the host that shares a pod's lifetime - properties: - group: - description: Group to map volume access to Default is no group - type: string - readOnly: - description: ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - type: boolean - registry: - description: Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes - type: string - tenant: - description: Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - type: string - user: - description: User to map volume access to Defaults to serivceaccount user - type: string - volume: - description: Volume is a string that references an already created Quobyte volume by name. - type: string - required: - - registry - - volume - type: object - rbd: - description: 'RBD represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - image: - description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - keyring: - description: 'Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - monitors: - description: 'A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - items: - type: string - type: array - pool: - description: 'The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - readOnly: - description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: boolean - secretRef: - description: 'SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - user: - description: 'The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - required: - - image - - monitors - type: object - scaleIO: - description: ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". - type: string - gateway: - description: The host address of the ScaleIO API Gateway. - type: string - protectionDomain: - description: The name of the ScaleIO Protection Domain for the configured storage. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - sslEnabled: - description: Flag to enable/disable SSL communication with Gateway, default false - type: boolean - storageMode: - description: Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - type: string - storagePool: - description: The ScaleIO Storage Pool associated with the protection domain. - type: string - system: - description: The name of the storage system as configured in ScaleIO. - type: string - volumeName: - description: The name of a volume already created in the ScaleIO system that is associated with this volume source. - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - description: 'Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - properties: - defaultMode: - description: 'Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - optional: - description: Specify whether the Secret or its keys must be defined - type: boolean - secretName: - description: 'Name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: string - type: object - storageos: - description: StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - volumeName: - description: VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - type: string - volumeNamespace: - description: VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - type: string - type: object - vsphereVolume: - description: VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - storagePolicyID: - description: Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - type: string - storagePolicyName: - description: Storage Policy Based Management (SPBM) profile name. - type: string - volumePath: - description: Path that identifies vSphere volume vmdk - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - required: - - containers - type: object - type: object - updateStrategy: - description: updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - properties: - rollingUpdate: - description: RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - properties: - partition: - description: Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0. - format: int32 - type: integer - type: object - type: - description: Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - type: string - type: object - volumeClaimTemplates: - description: 'volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. TODO: Define the behavior if a claim already exists with the same name.' - items: - description: PersistentVolumeClaim is a user's request for and claim to a persistent volume - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: 'Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - accessModes: - description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - dataSource: - description: 'This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: 'Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - resources: - description: 'Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - selector: - description: A label query over volumes to consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - storageClassName: - description: 'Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: VolumeName is the binding reference to the PersistentVolume backing this claim. - type: string - type: object - status: - description: 'Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - accessModes: - description: 'AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Represents the actual resources of the underlying volume. - type: object - conditions: - description: Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'. - items: - description: PersistentVolumeClaimCondition contails details about state of pvc - properties: - lastProbeTime: - description: Last time we probed the condition. - format: date-time - type: string - lastTransitionTime: - description: Last time the condition transitioned from one status to another. - format: date-time - type: string - message: - description: Human-readable message indicating details about last transition. - type: string - reason: - description: Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "ResizeStarted" that means the underlying persistent volume is being resized. - type: string - status: - type: string - type: - description: PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type - type: string - required: - - status - - type - type: object - type: array - phase: - description: Phase represents the current phase of PersistentVolumeClaim. - type: string - type: object - type: object - type: array - required: - - selector - - serviceName - - template - type: object - status: - description: ReplicasetTemplateStatus defines the observed state of ReplicasetTemplate - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_roles.tarantool.io.yaml b/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_roles.tarantool.io.yaml deleted file mode 100644 index 1eddd54e..00000000 --- a/helm-charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_roles.tarantool.io.yaml +++ /dev/null @@ -1,4325 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.7.0 - creationTimestamp: null - name: roles.tarantool.io -spec: - group: tarantool.io - names: - kind: Role - listKind: RoleList - plural: roles - singular: role - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Role is the Schema for the roles API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: RoleSpec defines the desired state of Role - properties: - numReplicasets: - description: NumReplicasets is a number of StatefulSets (Tarantol replicasets) created under this Role - format: int32 - type: integer - selector: - description: Selector is a LabelSelector to find ReplicasetTemplate resources from which StatefulSet created - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - storageTemplate: - description: ReplicasetTemplate is the Schema for the replicasettemplates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: A StatefulSetSpec is the specification of a StatefulSet. - properties: - minReadySeconds: - description: Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. - format: int32 - type: integer - podManagementPolicy: - description: podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once. - type: string - replicas: - description: 'replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. TODO: Consider a rename of this field.' - format: int32 - type: integer - revisionHistoryLimit: - description: revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - format: int32 - type: integer - selector: - description: 'selector is a label query over pods that should match the replica count. It must match the pod template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - serviceName: - description: 'serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller.' - type: string - template: - description: template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: 'Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' - properties: - activeDeadlineSeconds: - description: Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer. - format: int64 - type: integer - affinity: - description: If specified, the pod's scheduling constraints - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. - items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - automountServiceAccountToken: - description: AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. - type: boolean - containers: - description: List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. - items: - description: A single application container that you want to run within a pod. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - dnsConfig: - description: Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. - properties: - nameservers: - description: A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. - items: - type: string - type: array - options: - description: A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy. - items: - description: PodDNSConfigOption defines DNS resolver options of a pod. - properties: - name: - description: Required. - type: string - value: - type: string - type: object - type: array - searches: - description: A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. - items: - type: string - type: array - type: object - dnsPolicy: - description: Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. - type: string - enableServiceLinks: - description: 'EnableServiceLinks indicates whether information about services should be injected into pod''s environment variables, matching the syntax of Docker links. Optional: Defaults to true.' - type: boolean - ephemeralContainers: - description: List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. - items: - description: An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Lifecycle is not allowed for ephemeral containers. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers. - type: string - ports: - description: Ports are not allowed for ephemeral containers. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - readinessProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: Probes are not allowed for ephemeral containers. - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - targetContainerName: - description: If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature. - type: string - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - hostAliases: - description: HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. - items: - description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. - properties: - hostnames: - description: Hostnames for the above IP address. - items: - type: string - type: array - ip: - description: IP address of the host file entry. - type: string - type: object - type: array - hostIPC: - description: 'Use the host''s ipc namespace. Optional: Default to false.' - type: boolean - hostNetwork: - description: Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false. - type: boolean - hostPID: - description: 'Use the host''s pid namespace. Optional: Default to false.' - type: boolean - hostname: - description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. - type: string - imagePullSecrets: - description: 'ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - items: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - type: array - initContainers: - description: 'List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' - items: - description: A single application container that you want to run within a pod. - properties: - args: - description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - command: - description: 'Entrypoint array. Not executed within a shell. The docker image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - items: - type: string - type: array - env: - description: List of environment variables to set in the container. Cannot be updated. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - items: - description: EnvFromSource represents the source of a set of ConfigMaps - properties: - configMapRef: - description: The ConfigMap to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - type: object - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - type: object - type: object - type: array - image: - description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod''s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - items: - description: ContainerPort represents a network port in a single container. - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - format: int32 - type: integer - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - format: int32 - type: integer - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - properties: - exec: - description: One and only one of the following should be specified. Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - format: int32 - type: integer - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: 'TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook' - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - items: - description: volumeDevice describes a mapping of a raw block device within a container. - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - items: - description: VolumeMount describes a mounting of a Volume within a container. - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - required: - - name - type: object - type: array - nodeName: - description: NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. - type: string - nodeSelector: - additionalProperties: - type: string - description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' - type: object - x-kubernetes-map-type: atomic - overhead: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.' - type: object - preemptionPolicy: - description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate. - type: string - priority: - description: The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. - format: int32 - type: integer - priorityClassName: - description: If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. - type: string - readinessGates: - description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' - items: - description: PodReadinessGate contains the reference to a pod condition - properties: - conditionType: - description: ConditionType refers to a condition in the pod's condition list with matching type. - type: string - required: - - conditionType - type: object - type: array - restartPolicy: - description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' - type: string - runtimeClassName: - description: 'RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.' - type: string - schedulerName: - description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. - type: string - securityContext: - description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.' - properties: - fsGroup: - description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any volume." - format: int64 - type: integer - fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.' - type: string - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by the containers in this pod. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - required: - - type - type: object - supplementalGroups: - description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. - items: - format: int64 - type: integer - type: array - sysctls: - description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. - items: - description: Sysctl defines a kernel parameter to be set - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - serviceAccount: - description: 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.' - type: string - serviceAccountName: - description: 'ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' - type: string - setHostnameAsFQDN: - description: If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. - type: boolean - shareProcessNamespace: - description: 'Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.' - type: boolean - subdomain: - description: If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. - type: string - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. - format: int64 - type: integer - tolerations: - description: If specified, the pod's tolerations. - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - type: array - topologySpreadConstraints: - description: TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. - items: - description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. - properties: - labelSelector: - description: LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - maxSkew: - description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' - format: int32 - type: integer - topologyKey: - description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try to put balanced number of pods into each bucket. It's a required field. - type: string - whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a pod if it doesn''t satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assigment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won''t make it *more* imbalanced. It''s a required field.' - type: string - required: - - maxSkew - - topologyKey - - whenUnsatisfiable - type: object - type: array - x-kubernetes-list-map-keys: - - topologyKey - - whenUnsatisfiable - x-kubernetes-list-type: map - volumes: - description: 'List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' - items: - description: Volume represents a named volume in a pod that may be accessed by any container in the pod. - properties: - awsElasticBlockStore: - description: 'AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' - format: int32 - type: integer - readOnly: - description: 'Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: boolean - volumeID: - description: 'Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: string - required: - - volumeID - type: object - azureDisk: - description: AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - properties: - cachingMode: - description: 'Host Caching mode: None, Read Only, Read Write.' - type: string - diskName: - description: The Name of the data disk in the blob storage - type: string - diskURI: - description: The URI the data disk in the blob storage - type: string - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - kind: - description: 'Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - description: AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - properties: - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretName: - description: the name of secret that contains Azure Storage Account Name and Key - type: string - shareName: - description: Share Name - type: string - required: - - secretName - - shareName - type: object - cephfs: - description: CephFS represents a Ceph FS mount on the host that shares a pod's lifetime - properties: - monitors: - description: 'Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - items: - type: string - type: array - path: - description: 'Optional: Used as the mounted root, rather than the full Ceph tree, default is /' - type: string - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: boolean - secretFile: - description: 'Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - secretRef: - description: 'Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - user: - description: 'Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - required: - - monitors - type: object - cinder: - description: 'Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - properties: - fsType: - description: 'Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: boolean - secretRef: - description: 'Optional: points to a secret object containing parameters used to connect to OpenStack.' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - volumeID: - description: 'volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - required: - - volumeID - type: object - configMap: - description: ConfigMap represents a configMap that should populate this volume - properties: - defaultMode: - description: 'Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its keys must be defined - type: boolean - type: object - csi: - description: CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - properties: - driver: - description: Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - type: string - fsType: - description: Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - type: string - nodePublishSecretRef: - description: NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - readOnly: - description: Specifies a read-only configuration for the volume. Defaults to false (read/write). - type: boolean - volumeAttributes: - additionalProperties: - type: string - description: VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - type: object - required: - - driver - type: object - downwardAPI: - description: DownwardAPI represents downward API about the pod that should populate this volume - properties: - defaultMode: - description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: Items is a list of downward API volume file - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - description: 'EmptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - properties: - medium: - description: 'What type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - description: 'Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - description: "Ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time. \n This is a beta feature and only available when the GenericEphemeralVolume feature gate is enabled." - properties: - volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." - properties: - metadata: - description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. - properties: - accessModes: - description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - dataSource: - description: 'This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: 'Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - resources: - description: 'Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - selector: - description: A label query over volumes to consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - storageClassName: - description: 'Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: VolumeName is the binding reference to the PersistentVolume backing this claim. - type: string - type: object - required: - - spec - type: object - type: object - fc: - description: FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - properties: - fsType: - description: 'Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - lun: - description: 'Optional: FC target lun number' - format: int32 - type: integer - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - targetWWNs: - description: 'Optional: FC target worldwide names (WWNs)' - items: - type: string - type: array - wwids: - description: 'Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' - items: - type: string - type: array - type: object - flexVolume: - description: FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - properties: - driver: - description: Driver is the name of the driver to use for this volume. - type: string - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - type: string - options: - additionalProperties: - type: string - description: 'Optional: Extra command options if any.' - type: object - readOnly: - description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - secretRef: - description: 'Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - required: - - driver - type: object - flocker: - description: Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - properties: - datasetName: - description: Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - type: string - datasetUUID: - description: UUID of the dataset. This is unique identifier of a Flocker dataset - type: string - type: object - gcePersistentDisk: - description: 'GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - format: int32 - type: integer - pdName: - description: 'Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: string - readOnly: - description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: boolean - required: - - pdName - type: object - gitRepo: - description: 'GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' - properties: - directory: - description: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - type: string - repository: - description: Repository URL - type: string - revision: - description: Commit hash for the specified revision. - type: string - required: - - repository - type: object - glusterfs: - description: 'Glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' - properties: - endpoints: - description: 'EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - path: - description: 'Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - readOnly: - description: 'ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: boolean - required: - - endpoints - - path - type: object - hostPath: - description: 'HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' - properties: - path: - description: 'Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - type: - description: 'Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - required: - - path - type: object - iscsi: - description: 'ISCSI represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' - properties: - chapAuthDiscovery: - description: whether support iSCSI Discovery CHAP authentication - type: boolean - chapAuthSession: - description: whether support iSCSI Session CHAP authentication - type: boolean - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - initiatorName: - description: Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. - type: string - iqn: - description: Target iSCSI Qualified Name. - type: string - iscsiInterface: - description: iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - type: string - lun: - description: iSCSI Target Lun number. - format: int32 - type: integer - portals: - description: iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - items: - type: string - type: array - readOnly: - description: ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - type: boolean - secretRef: - description: CHAP Secret for iSCSI target and initiator authentication - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - targetPortal: - description: iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - description: 'Volume''s name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - nfs: - description: 'NFS represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - properties: - path: - description: 'Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - readOnly: - description: 'ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: boolean - server: - description: 'Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - description: 'PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - claimName: - description: 'ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: string - readOnly: - description: Will force the ReadOnly setting in VolumeMounts. Default false. - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - description: PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - pdID: - description: ID that identifies Photon Controller persistent disk - type: string - required: - - pdID - type: object - portworxVolume: - description: PortworxVolume represents a portworx volume attached and mounted on kubelets host machine - properties: - fsType: - description: FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - volumeID: - description: VolumeID uniquely identifies a Portworx volume - type: string - required: - - volumeID - type: object - projected: - description: Items for all in one resources secrets, configmaps, and downward API - properties: - defaultMode: - description: Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - format: int32 - type: integer - sources: - description: list of volume projections - items: - description: Projection that may be projected along with other supported volume types - properties: - configMap: - description: information about the configMap data to project - properties: - items: - description: If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its keys must be defined - type: boolean - type: object - downwardAPI: - description: information about the downwardAPI data to project - properties: - items: - description: Items is a list of DownwardAPIVolume file - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - description: information about the secret data to project - properties: - items: - description: If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - type: object - serviceAccountToken: - description: information about the serviceAccountToken data to project - properties: - audience: - description: Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. - type: string - expirationSeconds: - description: ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - format: int64 - type: integer - path: - description: Path is the path relative to the mount point of the file to project the token into. - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - description: Quobyte represents a Quobyte mount on the host that shares a pod's lifetime - properties: - group: - description: Group to map volume access to Default is no group - type: string - readOnly: - description: ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - type: boolean - registry: - description: Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes - type: string - tenant: - description: Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - type: string - user: - description: User to map volume access to Defaults to serivceaccount user - type: string - volume: - description: Volume is a string that references an already created Quobyte volume by name. - type: string - required: - - registry - - volume - type: object - rbd: - description: 'RBD represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' - properties: - fsType: - description: 'Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - image: - description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - keyring: - description: 'Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - monitors: - description: 'A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - items: - type: string - type: array - pool: - description: 'The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - readOnly: - description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: boolean - secretRef: - description: 'SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - user: - description: 'The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - required: - - image - - monitors - type: object - scaleIO: - description: ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". - type: string - gateway: - description: The host address of the ScaleIO API Gateway. - type: string - protectionDomain: - description: The name of the ScaleIO Protection Domain for the configured storage. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - sslEnabled: - description: Flag to enable/disable SSL communication with Gateway, default false - type: boolean - storageMode: - description: Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - type: string - storagePool: - description: The ScaleIO Storage Pool associated with the protection domain. - type: string - system: - description: The name of the storage system as configured in ScaleIO. - type: string - volumeName: - description: The name of a volume already created in the ScaleIO system that is associated with this volume source. - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - description: 'Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - properties: - defaultMode: - description: 'Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - items: - description: If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - items: - description: Maps a string key to a path within a volume. - properties: - key: - description: The key to project. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - format: int32 - type: integer - path: - description: The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - required: - - key - - path - type: object - type: array - optional: - description: Specify whether the Secret or its keys must be defined - type: boolean - secretName: - description: 'Name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: string - type: object - storageos: - description: StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - volumeName: - description: VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - type: string - volumeNamespace: - description: VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - type: string - type: object - vsphereVolume: - description: VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - properties: - fsType: - description: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - storagePolicyID: - description: Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - type: string - storagePolicyName: - description: Storage Policy Based Management (SPBM) profile name. - type: string - volumePath: - description: Path that identifies vSphere volume vmdk - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - required: - - containers - type: object - type: object - updateStrategy: - description: updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - properties: - rollingUpdate: - description: RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - properties: - partition: - description: Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0. - format: int32 - type: integer - type: object - type: - description: Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - type: string - type: object - volumeClaimTemplates: - description: 'volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. TODO: Define the behavior if a claim already exists with the same name.' - items: - description: PersistentVolumeClaim is a user's request for and claim to a persistent volume - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: 'Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - accessModes: - description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - dataSource: - description: 'This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: 'Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - resources: - description: 'Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - selector: - description: A label query over volumes to consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - storageClassName: - description: 'Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: VolumeName is the binding reference to the PersistentVolume backing this claim. - type: string - type: object - status: - description: 'Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - properties: - accessModes: - description: 'AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - items: - type: string - type: array - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Represents the actual resources of the underlying volume. - type: object - conditions: - description: Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'. - items: - description: PersistentVolumeClaimCondition contails details about state of pvc - properties: - lastProbeTime: - description: Last time we probed the condition. - format: date-time - type: string - lastTransitionTime: - description: Last time the condition transitioned from one status to another. - format: date-time - type: string - message: - description: Human-readable message indicating details about last transition. - type: string - reason: - description: Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "ResizeStarted" that means the underlying persistent volume is being resized. - type: string - status: - type: string - type: - description: PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type - type: string - required: - - status - - type - type: object - type: array - phase: - description: Phase represents the current phase of PersistentVolumeClaim. - type: string - type: object - type: object - type: array - required: - - selector - - serviceName - - template - type: object - status: - description: ReplicasetTemplateStatus defines the observed state of ReplicasetTemplate - type: object - type: object - type: object - status: - description: RoleStatus defines the observed state of Role - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/helm-charts/tarantool-operator/templates/_helpers.tpl b/helm-charts/tarantool-operator/templates/_helpers.tpl deleted file mode 100644 index 43f15203..00000000 --- a/helm-charts/tarantool-operator/templates/_helpers.tpl +++ /dev/null @@ -1,63 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "helm-chart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "helm-chart.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "helm-chart.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "helm-chart.labels" -}} -helm.sh/chart: {{ include "helm-chart.chart" . }} -{{ include "helm-chart.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "helm-chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "helm-chart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "helm-chart.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "helm-chart.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_role_leader-election-role.yaml b/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_role_leader-election-role.yaml deleted file mode 100644 index d11c2dd8..00000000 --- a/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_role_leader-election-role.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_rolebinding_leader-election-rolebinding.yaml b/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_rolebinding_leader-election-rolebinding.yaml deleted file mode 100644 index dcbe40e5..00000000 --- a/helm-charts/tarantool-operator/templates/default_rbac.authorization.k8s.io_v1_rolebinding_leader-election-rolebinding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: leader-election-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: leader-election-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: {{ .Release.Namespace }} diff --git a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_manager-role.yaml b/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_manager-role.yaml deleted file mode 100644 index 98133243..00000000 --- a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_manager-role.yaml +++ /dev/null @@ -1,132 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: manager-role -rules: -- apiGroups: - - "" - resources: - - endpoints - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - pods - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - services - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - apps - resources: - - statefulsets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - tarantool.io - resources: - - clusters - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - tarantool.io - resources: - - clusters/finalizers - verbs: - - update -- apiGroups: - - tarantool.io - resources: - - clusters/status - verbs: - - get - - patch - - update -- apiGroups: - - tarantool.io - resources: - - replicasettemplates - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - tarantool.io - resources: - - replicasettemplates/finalizers - verbs: - - update -- apiGroups: - - tarantool.io - resources: - - replicasettemplates/status - verbs: - - get - - patch - - update -- apiGroups: - - tarantool.io - resources: - - roles - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - tarantool.io - resources: - - roles/finalizers - verbs: - - update -- apiGroups: - - tarantool.io - resources: - - roles/status - verbs: - - get - - patch - - update diff --git a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_metrics-reader.yaml b/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_metrics-reader.yaml deleted file mode 100644 index 03ce329d..00000000 --- a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_metrics-reader.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: metrics-reader -rules: -- nonResourceURLs: - - /metrics - verbs: - - get diff --git a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_proxy-role.yaml b/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_proxy-role.yaml deleted file mode 100644 index 80e1857c..00000000 --- a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrole_proxy-role.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: proxy-role -rules: -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create diff --git a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_manager-rolebinding.yaml b/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_manager-rolebinding.yaml deleted file mode 100644 index f39c0ad3..00000000 --- a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_manager-rolebinding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: manager-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: manager-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: {{ .Release.Namespace }} diff --git a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_proxy-rolebinding.yaml b/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_proxy-rolebinding.yaml deleted file mode 100644 index 8f3bb6b5..00000000 --- a/helm-charts/tarantool-operator/templates/rbac.authorization.k8s.io_v1_clusterrolebinding_proxy-rolebinding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: proxy-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: proxy-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: {{ .Release.Namespace }} diff --git a/helm-charts/tarantool-operator/templates/system_apps_v1_deployment_controller-manager.yaml b/helm-charts/tarantool-operator/templates/system_apps_v1_deployment_controller-manager.yaml deleted file mode 100644 index 4d2b5620..00000000 --- a/helm-charts/tarantool-operator/templates/system_apps_v1_deployment_controller-manager.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - control-plane: controller-manager - name: controller-manager - namespace: {{ .Release.Namespace }} -spec: - replicas: 1 - selector: - matchLabels: - control-plane: controller-manager - template: - metadata: - labels: - control-plane: controller-manager - spec: - containers: - - args: - - --leader-elect - command: - - /manager - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - name: manager - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - resources: - limits: - cpu: 200m - memory: 100Mi - requests: - cpu: 100m - memory: 20Mi - securityContext: - allowPrivilegeEscalation: false - securityContext: - runAsNonRoot: true - serviceAccountName: controller-manager - terminationGracePeriodSeconds: 10 diff --git a/helm-charts/tarantool-operator/templates/system_v1_service_controller-manager-metrics-service.yaml b/helm-charts/tarantool-operator/templates/system_v1_service_controller-manager-metrics-service.yaml deleted file mode 100644 index d6ef213c..00000000 --- a/helm-charts/tarantool-operator/templates/system_v1_service_controller-manager-metrics-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-service - namespace: {{ .Release.Namespace }} -spec: - ports: - - name: https - port: 8443 - protocol: TCP - targetPort: https - selector: - control-plane: controller-manager diff --git a/helm-charts/tarantool-operator/templates/system_v1_serviceaccount_controller-manager.yaml b/helm-charts/tarantool-operator/templates/system_v1_serviceaccount_controller-manager.yaml deleted file mode 100644 index 7e7eb826..00000000 --- a/helm-charts/tarantool-operator/templates/system_v1_serviceaccount_controller-manager.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: controller-manager - namespace: {{ .Release.Namespace }} diff --git a/helm-charts/tarantool-operator/values.yaml b/helm-charts/tarantool-operator/values.yaml deleted file mode 100644 index fa62b88e..00000000 --- a/helm-charts/tarantool-operator/values.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Default values for helm-chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -image: - repository: tarantool/tarantool-operator - tag: 0.0.11 - pullPolicy: IfNotPresent diff --git a/internal/aliases.go b/internal/aliases.go new file mode 100644 index 00000000..720f3990 --- /dev/null +++ b/internal/aliases.go @@ -0,0 +1,21 @@ +package internal + +import ( + "github.com/tarantool/tarantool-operator/internal/context" + "github.com/tarantool/tarantool-operator/internal/controller" +) + +type ( + ClusterControllerCE = controller.ClusterController + ClusterContextCE = context.ClusterContext +) + +type ( + RoleControllerCE = controller.RoleController + RoleContextCE = context.RoleContext +) + +type ( + CartridgeConfigControllerCE = controller.CartridgeConfigController + CartridgeConfigContextCE = context.CartridgeConfigContext +) diff --git a/internal/context/cartridge_config.go b/internal/context/cartridge_config.go new file mode 100644 index 00000000..cba11f45 --- /dev/null +++ b/internal/context/cartridge_config.go @@ -0,0 +1,41 @@ +package context + +import ( + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type CartridgeConfigContext struct { + *reconciliation.CommonContext + + CartridgeConfig *v1beta1.CartridgeConfig +} + +func (r *CartridgeConfigContext) SetCartridgeConfig(config *v1beta1.CartridgeConfig) { + r.CartridgeConfig = config +} + +func (r *CartridgeConfigContext) GetCartridgeConfig() *v1beta1.CartridgeConfig { + return r.CartridgeConfig +} + +func (r *CartridgeConfigContext) HasRequestedObject() bool { + return r.CartridgeConfig != nil +} + +func (r *CartridgeConfigContext) SetRequestedObject(obj client.Object) error { + cartridgeConfig, ok := obj.(*v1beta1.CartridgeConfig) + if !ok { + return errors.New("CartridgeConfigContext used with wrong k8s object") + } + + r.CartridgeConfig = cartridgeConfig + + return nil +} + +func (r *CartridgeConfigContext) GetRequestedObject() client.Object { + return r.CartridgeConfig +} diff --git a/internal/context/cluster.go b/internal/context/cluster.go new file mode 100644 index 00000000..a5f370cd --- /dev/null +++ b/internal/context/cluster.go @@ -0,0 +1,42 @@ +package context + +import ( + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type ClusterContext struct { + *reconciliation.CommonContext + + Cluster *v1beta1.Cluster +} + +func (r *ClusterContext) SetCluster(cluster *v1beta1.Cluster) { + r.Cluster = cluster + r.CommonContext.SetRelatedCluster(cluster) +} + +func (r *ClusterContext) GetCluster() *v1beta1.Cluster { + return r.Cluster +} + +func (r *ClusterContext) HasRequestedObject() bool { + return r.GetCluster() != nil +} + +func (r *ClusterContext) SetRequestedObject(obj client.Object) error { + cluster, ok := obj.(*v1beta1.Cluster) + if !ok { + return errors.New("ClusterContext used with wrong k8s object") + } + + r.SetCluster(cluster) + + return nil +} + +func (r *ClusterContext) GetRequestedObject() client.Object { + return r.GetCluster() +} diff --git a/internal/context/role.go b/internal/context/role.go new file mode 100644 index 00000000..45fb1091 --- /dev/null +++ b/internal/context/role.go @@ -0,0 +1,41 @@ +package context + +import ( + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type RoleContext struct { + *reconciliation.CommonContext + + Role *v1beta1.Role +} + +func (r *RoleContext) SetRole(role *v1beta1.Role) { + r.Role = role +} + +func (r *RoleContext) GetRole() *v1beta1.Role { + return r.Role +} + +func (r *RoleContext) HasRequestedObject() bool { + return r.GetRole() != nil +} + +func (r *RoleContext) SetRequestedObject(obj client.Object) error { + role, ok := obj.(*v1beta1.Role) + if !ok { + return errors.New("RoleContext used with wrong k8s object") + } + + r.SetRole(role) + + return nil +} + +func (r *RoleContext) GetRequestedObject() client.Object { + return r.GetRole() +} diff --git a/internal/controller/cartridge_config.go b/internal/controller/cartridge_config.go new file mode 100644 index 00000000..19db164f --- /dev/null +++ b/internal/controller/cartridge_config.go @@ -0,0 +1,9 @@ +package controller + +import ( + "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type CartridgeConfigController struct { + *reconciliation.CommonCartridgeConfigController +} diff --git a/internal/controller/cluster.go b/internal/controller/cluster.go new file mode 100644 index 00000000..e208a06a --- /dev/null +++ b/internal/controller/cluster.go @@ -0,0 +1,37 @@ +package controller + +import ( + "context" + + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/api" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type ClusterController struct { + *reconciliation.CommonClusterController +} + +func (r *ClusterController) IsAllRolesAtPhase(ctx context.Context, cluster api.Cluster, phase v1beta1.RolePhase) (bool, error) { + selector := r.LabelsManager.SelectorByClusterName(cluster) + + roleList := &v1beta1.RoleList{} + + err := r.List(ctx, roleList, &client.ListOptions{LabelSelector: selector, Namespace: cluster.GetNamespace()}) + if err != nil { + return false, err + } + + if len(roleList.Items) == 0 { + return false, nil + } + + for _, role := range roleList.Items { + if role.GetPhase() != phase { + return false, nil + } + } + + return true, nil +} diff --git a/internal/controller/role.go b/internal/controller/role.go new file mode 100644 index 00000000..5e32458c --- /dev/null +++ b/internal/controller/role.go @@ -0,0 +1,18 @@ +package controller + +import ( + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/internal/implementation" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type RoleController struct { + *reconciliation.CommonRoleController + + ReplicasetsManger *implementation.ReplicasetsManger +} + +func (r *RoleController) GetReplicasetsManger() k8s.ReplicasetsManger[*v1beta1.Role] { + return r.ReplicasetsManger +} diff --git a/internal/implementation/replicasets_manger.go b/internal/implementation/replicasets_manger.go new file mode 100644 index 00000000..85827258 --- /dev/null +++ b/internal/implementation/replicasets_manger.go @@ -0,0 +1,256 @@ +package implementation + +import ( + "context" + "fmt" + "strconv" + + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/api" + "github.com/tarantool/tarantool-operator/pkg/utils" + appsv1 "k8s.io/api/apps/v1" + v1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type ReplicasetsManger struct { + *ResourcesManager + + UUIDSpace uuid.UUID +} + +func (r *ReplicasetsManger) GetReplicasetUUID(role *v1beta1.Role, ordinal int32) string { + replicasetUUID := uuid.NewSHA1( + r.UUIDSpace, + []byte(fmt.Sprintf("%s-%d", role.GetName(), ordinal)), + ) + + return replicasetUUID.String() +} + +func (r *ReplicasetsManger) GetAdvertiseURI(cluster api.Cluster, pod *v1.Pod) string { + return fmt.Sprintf( + "%s.%s.%s.svc.%s:%d", + pod.GetObjectMeta().GetName(), // Instance name + cluster.GetName(), // Cartridge cluster name + pod.GetObjectMeta().GetNamespace(), // Namespace + cluster.GetDomain(), // Cluster domain name + cluster.GetListenPort(), + ) +} + +func (r *ReplicasetsManger) CreateStatefulSets(ctx context.Context, cluster api.Cluster, role *v1beta1.Role) error { + for ordinal := int32(0); ordinal < role.GetReplicasets(); ordinal++ { + selector := r.LabelsManager.SelectorByReplicasetOrdinal(role, ordinal) + + stsList, err := r.ListStatefulSets(ctx, role.GetNamespace(), selector) + if err == nil && len(stsList.Items) > 0 { + continue + } + + if err != nil && !apierrors.IsNotFound(err) { + return err + } + + err = r.createStatefulSet(ctx, cluster, role, ordinal) + if err != nil { + return err + } + } + + return nil +} + +func (r *ReplicasetsManger) UpdateStatefulSets(ctx context.Context, cluster api.Cluster, role *v1beta1.Role) (complete bool, err error) { + var ( + updated bool + ordinal int64 + done = true + stsList *appsv1.StatefulSetList + ) + + stsList, err = r.ListStatefulSets(ctx, role.GetNamespace(), r.LabelsManager.SelectorByRoleName(role)) + if err != nil { + return + } + + for key := range stsList.Items { + sts := &stsList.Items[key] + + ordinal, err = strconv.ParseInt(sts.GetLabels()[r.LabelsManager.ReplicasetOrdinal()], 10, 32) + if err != nil { + return false, err + } + + updated, err = r.updateStatefulSet(ctx, cluster, role, sts, int32(ordinal)) + if err != nil { + return false, err + } + + if !updated { + done = false + } + } + + return done, nil +} + +func (r *ReplicasetsManger) createStatefulSet(ctx context.Context, cluster api.Cluster, role *v1beta1.Role, ordinal int32) error { + stsName, err := role.GetReplicasetName(ordinal) + if err != nil { + return err + } + + replicasetUUID := r.GetReplicasetUUID(role, ordinal) + revisionHistoryLimit := int32(1) + + selectorLabels := map[string]string{ + r.LabelsManager.ClusterName(): cluster.GetName(), + r.LabelsManager.RoleName(): role.GetName(), + r.LabelsManager.ReplicasetName(): stsName, + r.LabelsManager.ReplicasetUUID(): replicasetUUID, + } + + sts := &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: stsName, + Namespace: role.GetNamespace(), + Labels: map[string]string{}, + }, + Spec: appsv1.StatefulSetSpec{ + Replicas: role.Spec.ReplicasetTemplate.Replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: selectorLabels, + }, + VolumeClaimTemplates: role.Spec.ReplicasetTemplate.VolumeClaimTemplates, + ServiceName: cluster.GetName(), + PodManagementPolicy: appsv1.ParallelPodManagement, + UpdateStrategy: appsv1.StatefulSetUpdateStrategy{ + Type: appsv1.OnDeleteStatefulSetStrategyType, + }, + RevisionHistoryLimit: &revisionHistoryLimit, + PersistentVolumeClaimRetentionPolicy: &appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy{ + WhenDeleted: appsv1.RetainPersistentVolumeClaimRetentionPolicyType, + WhenScaled: appsv1.RetainPersistentVolumeClaimRetentionPolicyType, + }, + }, + } + + _, err = r.syncStatefulSet(cluster, role, sts, ordinal, replicasetUUID) + if err != nil { + return err + } + + return r.CreateObject(ctx, sts) +} + +func (r *ReplicasetsManger) updateStatefulSet(ctx context.Context, cluster api.Cluster, role *v1beta1.Role, sts *appsv1.StatefulSet, ordinal int32) (bool, error) { + replicasetUUID := r.GetReplicasetUUID(role, ordinal) + + changed, err := r.syncStatefulSet(cluster, role, sts, ordinal, replicasetUUID) + if err != nil { + return false, err + } + + if changed { + err = r.UpdateObject(ctx, sts) + if err != nil { + return false, err + } + } + + return true, nil +} + +func (r *ReplicasetsManger) syncStatefulSet( + cluster api.Cluster, + role *v1beta1.Role, + sts *appsv1.StatefulSet, + ordinal int32, + replicasetUUID string, +) (bool, error) { + var ( + changed bool + err error + ) + + // Prepare revision hash + rsPodTemplateHash, err := utils.HashObject(&role.Spec.ReplicasetTemplate.PodTemplate) + if err != nil { + return changed, err + } + + // Prepare labels for all + clusterLabels := map[string]string{ + r.LabelsManager.ClusterName(): cluster.GetName(), + } + roleLabels := role.GetLabels() + stsLabels := utils.MergeMaps(clusterLabels, roleLabels, map[string]string{ + r.LabelsManager.ClusterName(): cluster.GetName(), + r.LabelsManager.RoleName(): role.GetName(), + r.LabelsManager.ReplicasetName(): sts.GetName(), + r.LabelsManager.ReplicasetUUID(): replicasetUUID, + r.LabelsManager.ReplicasetOrdinal(): fmt.Sprintf("%d", ordinal), + r.LabelsManager.ReplicasetPodTemplateHash(): rsPodTemplateHash, + }) + + podTemplateLabels := utils.MergeMaps( + role.Spec.ReplicasetTemplate.PodTemplate.GetLabels(), + stsLabels, + ) + + //// If StatefulSet still not controlled by role we need to take control + changed, err = r.ControlObject(role, sts) + if err != nil { + return changed, err + } + + if *role.Spec.ReplicasetTemplate.Replicas > *sts.Spec.Replicas { + sts.Spec.Replicas = role.Spec.ReplicasetTemplate.Replicas + + changed = true + } + + if role.Spec.ReplicasetTemplate.MinReadySeconds != sts.Spec.MinReadySeconds { + sts.Spec.MinReadySeconds = role.Spec.ReplicasetTemplate.MinReadySeconds + + changed = true + } + + // If current hash of pod template stored in StatefulSet labels does not match + // calculated hash of role's pod template, when it means something changed. + // So we need to update StatefulSet + if rsPodTemplateHash != sts.Labels[r.LabelsManager.ReplicasetPodTemplateHash()] { + role.Spec.ReplicasetTemplate.PodTemplate.DeepCopyInto(&sts.Spec.Template) + + changed = true + } + + // Labels of StatefulSet should match + // When actual StatefulSet labels does not match that rule we need to update StatefulSet. + if !cmp.Equal(stsLabels, sts.GetLabels()) { + sts.SetLabels(stsLabels) + + changed = true + } + + // Labels of PodTemplate should be sum of required labels and labels defined in ReplicasetTemplate.PodTemplate.Labels + // When actual StatefulSet labels does not match that rule we need to update StatefulSet. + if !cmp.Equal(podTemplateLabels, sts.Spec.Template.GetLabels()) { + sts.Spec.Template.SetLabels(podTemplateLabels) + + changed = true + } + + // Annotations of StatefulSet is a copy role annotations + if !cmp.Equal(role.GetAnnotations(), sts.GetAnnotations()) { + sts.SetAnnotations(role.GetAnnotations()) + + changed = true + } + + return changed, nil +} diff --git a/internal/implementation/resources_manager.go b/internal/implementation/resources_manager.go new file mode 100644 index 00000000..76b84795 --- /dev/null +++ b/internal/implementation/resources_manager.go @@ -0,0 +1,50 @@ +package implementation + +import ( + "context" + + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/api" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type ResourcesManager struct { + *k8s.CommonResourcesManager + + LabelsManager k8s.LabelsManager +} + +func (r *ResourcesManager) GetCluster(ctx context.Context, ns, name string) (api.Cluster, error) { + cluster := &v1beta1.Cluster{} + selector := types.NamespacedName{ + Namespace: ns, + Name: name, + } + + err := r.Get(ctx, selector, cluster) + if err != nil { + return nil, err + } + + return cluster, nil +} + +func (r *ResourcesManager) GetClusterRoles(ctx context.Context, cluster api.Cluster) ([]api.Role, error) { + selector := r.LabelsManager.SelectorByClusterName(cluster) + + roleList := &v1beta1.RoleList{} + + err := r.List(ctx, roleList, &client.ListOptions{LabelSelector: selector, Namespace: cluster.GetNamespace()}) + if err != nil { + return nil, err + } + + result := make([]api.Role, len(roleList.Items)) + for k := range roleList.Items { + result[k] = &roleList.Items[k] + } + + return result, nil +} diff --git a/internal/steps/cartridge_config.go b/internal/steps/cartridge_config.go new file mode 100644 index 00000000..86dd8941 --- /dev/null +++ b/internal/steps/cartridge_config.go @@ -0,0 +1,22 @@ +package steps + +import ( + "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal/context" + . "github.com/tarantool/tarantool-operator/internal/controller" + "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/cartridge" +) + +func ResetCartridgeConfigStatus() *cartridge.ResetStatusStep[*v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController] { + return &cartridge.ResetStatusStep[*v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController]{} +} + +func SetCartridgeConfigPhase(phase v1beta1.CartridgeConfigPhase) *cartridge.SetPhaseStep[v1beta1.CartridgeConfigPhase, *v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController] { + return &cartridge.SetPhaseStep[v1beta1.CartridgeConfigPhase, *v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController]{ + Phase: phase, + } +} + +func ConfigureCartridge() *cartridge.ConfigureStep[*v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController] { + return &cartridge.ConfigureStep[*v1beta1.CartridgeConfig, *CartridgeConfigContext, *CartridgeConfigController]{} +} diff --git a/internal/steps/cluster.go b/internal/steps/cluster.go new file mode 100644 index 00000000..86031f2b --- /dev/null +++ b/internal/steps/cluster.go @@ -0,0 +1,46 @@ +package steps + +import ( + . "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal/context" + . "github.com/tarantool/tarantool-operator/internal/controller" + "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/cluster" +) + +func CheckClusterDeletion() *cluster.CheckDeletionStep[*Cluster, *ClusterContext, *ClusterController] { + return &cluster.CheckDeletionStep[*Cluster, *ClusterContext, *ClusterController]{} +} + +func ResetClusterStatus() *cluster.ResetStatusStep[*Cluster, *ClusterContext, *ClusterController] { + return &cluster.ResetStatusStep[*Cluster, *ClusterContext, *ClusterController]{} +} + +func SetClusterPhase(phase ClusterPhase) *cluster.SetPhaseStep[ClusterPhase, *Cluster, *ClusterContext, *ClusterController] { + return &cluster.SetPhaseStep[ClusterPhase, *Cluster, *ClusterContext, *ClusterController]{ + Phase: phase, + } +} + +func SyncClusterWideService() *cluster.SyncClusterWideServiceStep[*Cluster, *ClusterContext, *ClusterController] { + return &cluster.SyncClusterWideServiceStep[*Cluster, *ClusterContext, *ClusterController]{} +} + +func WaitForRolesPhases(expectedPhases ...RolePhase) *cluster.WaitForRolesPhaseStep[RolePhase, *Cluster, *ClusterContext, *ClusterController] { + return &cluster.WaitForRolesPhaseStep[RolePhase, *Cluster, *ClusterContext, *ClusterController]{ + ExpectedPhases: expectedPhases, + } +} + +type BootstrapParams struct { + OnError ClusterPhase +} + +func Bootstrap(params BootstrapParams) *cluster.BootstrapStep[ClusterPhase, *Cluster, *ClusterContext, *ClusterController] { + return &cluster.BootstrapStep[ClusterPhase, *Cluster, *ClusterContext, *ClusterController]{ + ErrorPhase: params.OnError, + } +} + +func ConfigureFailover() *cluster.ConfigureFailoverStep[*Cluster, *ClusterContext, *ClusterController] { + return &cluster.ConfigureFailoverStep[*Cluster, *ClusterContext, *ClusterController]{} +} diff --git a/internal/steps/role.go b/internal/steps/role.go new file mode 100644 index 00000000..660df932 --- /dev/null +++ b/internal/steps/role.go @@ -0,0 +1,52 @@ +package steps + +import ( + . "github.com/tarantool/tarantool-operator/apis/v1beta1" + . "github.com/tarantool/tarantool-operator/internal" + "github.com/tarantool/tarantool-operator/pkg/reconciliation/steps/role" +) + +func ResetRoleStatus() *role.ResetStatusStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.ResetStatusStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} + +func SetRolePhase(phase RolePhase) *role.SetPhaseStep[RolePhase, *Role, *RoleContextCE, *RoleControllerCE] { + return &role.SetPhaseStep[RolePhase, *Role, *RoleContextCE, *RoleControllerCE]{ + Phase: phase, + } +} + +func CreateStatefulSets() *role.CreateStatefulSetsStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.CreateStatefulSetsStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} + +func UpdateStatefulSets() *role.UpdateStatefulSetsStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.UpdateStatefulSetsStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} + +func EnsureCartridgeReady() *role.EnsureCartridgeReadyStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.EnsureCartridgeReadyStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} + +type JoinInstancesParams struct { + ConfigErrorPhase RolePhase +} + +func JoinInstances(params JoinInstancesParams) *role.JoinInstancesStep[RolePhase, *Role, *RoleContextCE, *RoleControllerCE] { + return &role.JoinInstancesStep[ + RolePhase, + *Role, + *RoleContextCE, + *RoleControllerCE, + ]{ + ConfigErrorPhase: params.ConfigErrorPhase, + } +} + +func ConfigureVShardRoles() *role.ConfigureVShardRolesStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.ConfigureVShardRolesStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} + +func SetVShardWeights() *role.SetVShardWeightsStep[*Role, *RoleContextCE, *RoleControllerCE] { + return &role.SetVShardWeightsStep[*Role, *RoleContextCE, *RoleControllerCE]{} +} diff --git a/main.go b/main.go index 3c867759..c24f8b6c 100644 --- a/main.go +++ b/main.go @@ -1,77 +1,51 @@ -/* -BSD 2-Clause License - -Copyright (c) 2019, Tarantool -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - package main import ( "flag" "os" - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that exec-entrypoint and run can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/controllers" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" - "github.com/tarantool/tarantool-operator/controllers" //+kubebuilder:scaffold:imports ) +const ManagerPort = 9443 + var ( scheme = runtime.NewScheme() setupLog = ctrl.Log.WithName("setup") ) func init() { - utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - - utilruntime.Must(tarantooliov1alpha1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme + utilruntime.Must(clientgoscheme.AddToScheme(scheme)) + utilruntime.Must(v1beta1.AddToScheme(scheme)) } func main() { - var metricsAddr string - var enableLeaderElection bool - var probeAddr string + var ( + metricsAddr string + enableLeaderElection bool + probeAddr string + ) + flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") + opts := zap.Options{ Development: true, } + opts.BindFlags(flag.CommandLine) flag.Parse() @@ -80,49 +54,59 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, MetricsBindAddress: metricsAddr, - Port: 9443, + Port: ManagerPort, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "0f93ee2c.tarantool.io", + // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily + // when the Manager ends. This requires the binary to immediately end when the + // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly + // speeds up voluntary leader transitions as the new leader don't have to wait + // LeaseDuration time first. + // + // In the default scaffold provided, the program ends immediately after + // the manager stops, so would be fine to enable this option. However, + // if you are doing or is intended to do any operation such as perform cleanups + // after the manager stops then its usage might be unsafe. + // LeaderElectionReleaseOnCancel: true, }) if err != nil { setupLog.Error(err, "unable to start manager") os.Exit(1) } - if err = (&controllers.ClusterReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { + clusterReconciler := controllers.NewClusterReconciler(mgr) + if err = clusterReconciler.SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "Cluster") os.Exit(1) } - if err = (&controllers.ReplicasetTemplateReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "ReplicasetTemplate") + + roleReconciler := controllers.NewRoleReconciler(mgr) + if err = roleReconciler.SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "Role") os.Exit(1) } - if err = (&controllers.RoleReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Role") + + cartridgeConfigReconciler := controllers.NewCartridgeConfigReconciler(mgr) + if err = cartridgeConfigReconciler.SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "CartridgeConfig") os.Exit(1) } + //+kubebuilder:scaffold:builder if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { setupLog.Error(err, "unable to set up health check") os.Exit(1) } + if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { setupLog.Error(err, "unable to set up ready check") os.Exit(1) } setupLog.Info("starting manager") + if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { setupLog.Error(err, "problem running manager") os.Exit(1) diff --git a/pkg/api/cartridge_config.go b/pkg/api/cartridge_config.go new file mode 100644 index 00000000..84466203 --- /dev/null +++ b/pkg/api/cartridge_config.go @@ -0,0 +1,20 @@ +package api + +import ( + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type CartridgeConfig interface { + client.Object + + GetData() []byte + + ResetStatus() +} + +type CartridgeConfigWithStatus[PhaseType comparable] interface { + CartridgeConfig + + SetPhase(phase PhaseType) + GetPhase() PhaseType +} diff --git a/pkg/api/cluster.go b/pkg/api/cluster.go new file mode 100644 index 00000000..485fe3ce --- /dev/null +++ b/pkg/api/cluster.go @@ -0,0 +1,29 @@ +package api + +import ( + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Cluster interface { + client.Object + + GetDomain() string + GetListenPort() int32 + + GetFailoverConfig() FailoverConfig + + SetLeader(leader string) + GetLeader() string + + MarkBootstrapped() + IsBootstrapped() bool + + ResetStatus() +} + +type ClusterWithStatus[PhaseType comparable] interface { + Cluster + + SetPhase(phase PhaseType) + GetPhase() PhaseType +} diff --git a/pkg/api/failover.go b/pkg/api/failover.go new file mode 100644 index 00000000..a363461d --- /dev/null +++ b/pkg/api/failover.go @@ -0,0 +1,44 @@ +package api + +import v1 "k8s.io/api/core/v1" + +type FailoverMode string + +const ( + FailoverModeDisabled FailoverMode = "disabled" + FailoverModeEventual FailoverMode = "eventual" + FailoverModeStateful FailoverMode = "stateful" + FailoverModeRaft FailoverMode = "raft" +) + +type FailoverStateProvider string + +const ( + FailoverStateProviderETCD2 FailoverStateProvider = "etcd2" + FailoverStateProviderStateboard FailoverStateProvider = "stateboard" +) + +type FailoverConfig interface { + GetMode() FailoverMode + GetTimeout() int32 + GetStateProvider() FailoverStateProvider + GetFencing() bool + GetFencingTimeout() int32 + GetFencingPause() int32 + + GetETCD2Config() FailoverETCD2Config + GetStateboardConfig() FailoverStateboardConfig +} + +type FailoverETCD2Config interface { + GetEndpoints() []string + GetUsername() string + GetPassword() v1.SecretReference + GetLockDelay() int32 + GetPrefix() string +} + +type FailoverStateboardConfig interface { + GetURI() string + GetPassword() v1.SecretReference +} diff --git a/pkg/api/role.go b/pkg/api/role.go new file mode 100644 index 00000000..ac10ff83 --- /dev/null +++ b/pkg/api/role.go @@ -0,0 +1,48 @@ +package api + +import ( + v1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + RolePending string = "Pending" + RoleWaitingForCluster string = "WaitingForCluster" + RoleWaitingForLeader string = "WaitingForLeader" + RoleWaitForCartridgeReady string = "WaitForCartridgeReady" + RoleJoining string = "Joining" + RoleConfiguring string = "Configuring" + RoleWaitingForBootstrap string = "WaitingForBootstrap" + RoleConfiguringWeights string = "ConfiguringWeights" + RoleReady string = "Ready" + RoleConfigError string = "ConfigError" +) + +type Role interface { + client.Object + + IsAllRw() bool + + GetReplicasetName(ordinal int32) (string, error) + + GetReplicasets() int32 + GetReplicas() int32 + + GetVolumeClaimTemplates() []v1.PersistentVolumeClaim + GetVShardConfig() VShardConfig + + ResetStatus() +} + +type VShardConfig interface { + GetGroupName() string + GetRoles() []string + GetWeight() int32 +} + +type RoleWithStatus[PhaseType comparable] interface { + Role + + SetPhase(phase PhaseType) + GetPhase() PhaseType +} diff --git a/pkg/election/election.go b/pkg/election/election.go new file mode 100644 index 00000000..6a29c2a2 --- /dev/null +++ b/pkg/election/election.go @@ -0,0 +1,176 @@ +package election + +import ( + "context" + + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/pkg/api" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "github.com/tarantool/tarantool-operator/pkg/utils" + v1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type LeaderElection struct { + client.Client + k8s.ResourcesManager + *events.Recorder +} + +var ( + ErrNoAvailableLeader = errors.New("no available leader pod") + ErrLeaderElectionConflict = errors.New("race condition during leader election") + ErrLeaderNotReady = errors.New("leader pod is not ready") + ErrLeaderWasNotElected = errors.New("leader was not elected") +) + +// GetLeaderInstance return first pod of first replicaset of first role. +func (r *LeaderElection) GetLeaderInstance(ctx context.Context, cluster api.Cluster) (*v1.Pod, error) { + leader, err := r.loadLeaderInstance(ctx, cluster) + if err != nil { + if errors.Is(err, ErrLeaderWasNotElected) || errors.Is(err, ErrLeaderNotReady) { + return r.ElectLeaderInstance(ctx, cluster) + } + } + + return leader, nil +} + +func (r *LeaderElection) ElectLeaderInstance(ctx context.Context, cluster api.Cluster) (*v1.Pod, error) { + leader, err := r.findNewLeaderInstance(ctx, cluster) + if err != nil { + return nil, err + } + + cluster.SetLeader(leader.GetName()) + + err = r.Status().Update(ctx, cluster) + if err != nil { + if apierrors.IsConflict(err) { + return nil, ErrLeaderElectionConflict + } + + return nil, err + } + + r.Event(cluster, NewTopologyLeaderElectedEvent(leader)) + + return leader, nil +} + +func (r *LeaderElection) loadLeaderInstance(ctx context.Context, cluster api.Cluster) (*v1.Pod, error) { + if cluster.GetLeader() == "" { + return nil, ErrLeaderWasNotElected + } + + leader, err := r.GetPod(ctx, cluster.GetNamespace(), cluster.GetLeader()) + if err != nil { + return nil, err + } + + if !r.CanBeLeader(cluster, leader) { + return nil, ErrLeaderNotReady + } + + return leader, nil +} + +// findLeaderInstance +// Leader is a running pod +// Leader should not be the same as previous leader +// cartridge container should be ready +// sidecar container should be ready if vshard was bootstrapped +// Order by: +// - RoleCE ordinal ascending +// - StatefulSet ordinal ascending +// - Pod ordinal ascending. +func (r *LeaderElection) findNewLeaderInstance(ctx context.Context, cluster api.Cluster) (*v1.Pod, error) { + var ( + err error + roles []api.Role + maxReplicasets = int32(0) + maxReplicas = int32(0) + ) + + roles, err = r.GetClusterRoles(ctx, cluster) + if err != nil { + return nil, err + } + + for _, role := range roles { + if maxReplicasets < role.GetReplicasets() { + maxReplicasets = role.GetReplicasets() + } + + if maxReplicas < role.GetReplicas() { + maxReplicas = role.GetReplicas() + } + } + + var ( + stsName string + podName string + pod *v1.Pod + ) + + for podOrdinal := int32(0); podOrdinal < maxReplicas; podOrdinal++ { + for replicasetOrdinal := int32(0); replicasetOrdinal < maxReplicasets; replicasetOrdinal++ { + for _, role := range roles { + if role.GetReplicasets() <= replicasetOrdinal { + continue + } + + if role.GetReplicas() <= podOrdinal { + continue + } + + stsName, err = role.GetReplicasetName(replicasetOrdinal) + if err != nil { + return nil, err + } + + podName = utils.GetStatefulSetPodName(stsName, podOrdinal) + if podName == cluster.GetLeader() { + continue + } + + pod, err = r.GetPod(ctx, cluster.GetNamespace(), podName) + if err != nil { + if apierrors.IsNotFound(err) { + continue + } + + return nil, err + } + + if r.CanBeLeader(cluster, pod) { + return pod, nil + } + } + } + } + + return nil, ErrNoAvailableLeader +} + +func (r *LeaderElection) CanBeLeader(cluster api.Cluster, pod *v1.Pod) bool { + if pod.GetDeletionTimestamp() != nil { + return false + } + + if !utils.IsPodRunning(pod) { + return false + } + + if !cluster.IsBootstrapped() { + return utils.IsPodDefaultContainerReady(pod) + } + + return utils.IsPodReady(pod) +} + +func (r *LeaderElection) IsLeader(cluster api.Cluster, pod *v1.Pod) bool { + return pod.GetNamespace() == cluster.GetNamespace() && cluster.GetLeader() == pod.GetName() +} diff --git a/pkg/election/events.go b/pkg/election/events.go new file mode 100644 index 00000000..35f59247 --- /dev/null +++ b/pkg/election/events.go @@ -0,0 +1,20 @@ +package election + +import ( + "fmt" + + "github.com/tarantool/tarantool-operator/pkg/events" + corev1 "k8s.io/api/core/v1" +) + +const ( + EventNewTopologyLeaderElected = "NewTopologyLeaderElected" +) + +func NewTopologyLeaderElectedEvent(leader *corev1.Pod) *events.Event { + return &events.Event{ + EventType: corev1.EventTypeNormal, + Reason: EventNewTopologyLeaderElected, + Message: fmt.Sprintf("Pod %s is a new topology leader", leader.GetName()), + } +} diff --git a/pkg/events/recorder.go b/pkg/events/recorder.go new file mode 100644 index 00000000..9075d69e --- /dev/null +++ b/pkg/events/recorder.go @@ -0,0 +1,33 @@ +package events + +import ( + "k8s.io/client-go/tools/record" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Event struct { + Annotations map[string]string + EventType string + Reason string + Message string +} + +type Recorder struct { + eventRecorder record.EventRecorder +} + +func (r *Recorder) Event(obj client.Object, event *Event) { + r.eventRecorder.AnnotatedEventf( + obj, + event.Annotations, + event.EventType, + event.Reason, + event.Message, + ) +} + +func NewRecorder(eventRecorder record.EventRecorder) *Recorder { + return &Recorder{ + eventRecorder: eventRecorder, + } +} diff --git a/pkg/k8s/labels_manager.go b/pkg/k8s/labels_manager.go new file mode 100644 index 00000000..a8e3aec8 --- /dev/null +++ b/pkg/k8s/labels_manager.go @@ -0,0 +1,95 @@ +package k8s + +import ( + "fmt" + + "github.com/tarantool/tarantool-operator/pkg/api" + "k8s.io/apimachinery/pkg/labels" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type LabelsManager interface { + ClusterName() string + RoleName() string + ReplicasetName() string + ReplicasetUUID() string + ReplicasetOrdinal() string + ReplicasetPodTemplateHash() string + + SelectorByClusterName(cluster api.Cluster) labels.Selector + SelectorByRoleName(role api.Role) labels.Selector + SelectorByReplicasetOrdinal(role api.Role, ordinal int32) labels.Selector + SelectorByReplicasetName(role api.Role, name string) labels.Selector +} + +type NamespacedLabelsManager struct { + Namespace string +} + +func (r *NamespacedLabelsManager) namespacedLabel(label string) string { + return fmt.Sprintf("%s/%s", r.Namespace, label) +} + +func (r *NamespacedLabelsManager) getClusterNameFromLabels(obj client.Object) string { + objLabels := obj.GetLabels() + + clusterName, ok := objLabels[r.ClusterName()] + if !ok { + return "" + } + + return clusterName +} + +func (r *NamespacedLabelsManager) ClusterName() string { + return r.namespacedLabel("cluster-name") +} + +func (r *NamespacedLabelsManager) RoleName() string { + return r.namespacedLabel("role-name") +} + +func (r *NamespacedLabelsManager) ReplicasetName() string { + return r.namespacedLabel("replicaset-name") +} + +func (r *NamespacedLabelsManager) ReplicasetUUID() string { + return r.namespacedLabel("replicaset-uuid") +} + +func (r *NamespacedLabelsManager) ReplicasetOrdinal() string { + return r.namespacedLabel("replicaset-ordinal") +} + +func (r *NamespacedLabelsManager) ReplicasetPodTemplateHash() string { + return r.namespacedLabel("replicaset-pod-template-hash") +} + +func (r *NamespacedLabelsManager) SelectorByClusterName(cluster api.Cluster) labels.Selector { + return labels.SelectorFromSet(map[string]string{ + r.ClusterName(): cluster.GetName(), + }) +} + +func (r *NamespacedLabelsManager) SelectorByRoleName(role api.Role) labels.Selector { + return labels.SelectorFromSet(map[string]string{ + r.ClusterName(): r.getClusterNameFromLabels(role), + r.RoleName(): role.GetName(), + }) +} + +func (r *NamespacedLabelsManager) SelectorByReplicasetOrdinal(role api.Role, ordinal int32) labels.Selector { + return labels.SelectorFromSet(map[string]string{ + r.ClusterName(): r.getClusterNameFromLabels(role), + r.RoleName(): role.GetName(), + r.ReplicasetOrdinal(): fmt.Sprintf("%d", ordinal), + }) +} + +func (r *NamespacedLabelsManager) SelectorByReplicasetName(role api.Role, name string) labels.Selector { + return labels.SelectorFromSet(map[string]string{ + r.ClusterName(): r.getClusterNameFromLabels(role), + r.RoleName(): role.GetName(), + r.ReplicasetName(): name, + }) +} diff --git a/pkg/k8s/replicasets_manager.go b/pkg/k8s/replicasets_manager.go new file mode 100644 index 00000000..8b7ad998 --- /dev/null +++ b/pkg/k8s/replicasets_manager.go @@ -0,0 +1,19 @@ +package k8s + +import ( + "context" + + "github.com/tarantool/tarantool-operator/pkg/api" + v1 "k8s.io/api/core/v1" +) + +type ReplicasetsManger[RoleType api.Role] interface { + // GetReplicasetUUID must return stable UUIDv5 as string for each replicaset + GetReplicasetUUID(role RoleType, ordinal int32) string + + // GetAdvertiseURI must return stable URI as string for each replicaset + GetAdvertiseURI(cluster api.Cluster, pod *v1.Pod) string + + CreateStatefulSets(ctx context.Context, cluster api.Cluster, role RoleType) error + UpdateStatefulSets(ctx context.Context, cluster api.Cluster, role RoleType) (complete bool, err error) +} diff --git a/pkg/k8s/resources_manager.go b/pkg/k8s/resources_manager.go new file mode 100644 index 00000000..bb3fc0ce --- /dev/null +++ b/pkg/k8s/resources_manager.go @@ -0,0 +1,153 @@ +package k8s + +import ( + "context" + + "github.com/tarantool/tarantool-operator/pkg/api" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" +) + +type ResourcesManager interface { + CreateObject(ctx context.Context, obj client.Object) error + UpdateObject(ctx context.Context, obj client.Object) error + ControlObject(owner client.Object, target client.Object) (bool, error) + GetPod(ctx context.Context, namespace, name string) (*corev1.Pod, error) + GetService(ctx context.Context, namespace, name string) (*corev1.Service, error) + ListStatefulSets(ctx context.Context, namespace string, selector labels.Selector) (*appsv1.StatefulSetList, error) + ListPods(ctx context.Context, namespace string, selector labels.Selector) (*corev1.PodList, error) + GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) + GetConfigMapValue(ctx context.Context, ns, name, key string) (string, error) + GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) + GetSecretValue(ctx context.Context, ns, name, key string) (string, error) + + GetCluster(ctx context.Context, ns, name string) (api.Cluster, error) + GetClusterRoles(ctx context.Context, cluster api.Cluster) ([]api.Role, error) +} + +type CommonResourcesManager struct { + client.Client + + Scheme *runtime.Scheme +} + +func (r *CommonResourcesManager) CreateObject(ctx context.Context, obj client.Object) error { + err := r.Create(ctx, obj) + if err != nil { + return err + } + + return nil +} + +func (r *CommonResourcesManager) UpdateObject(ctx context.Context, obj client.Object) error { + err := r.Update(ctx, obj) + if err != nil { + return err + } + + return nil +} + +func (r *CommonResourcesManager) ControlObject(owner client.Object, target client.Object) (bool, error) { + if metav1.IsControlledBy(target, owner) { + return false, nil + } + + err := controllerutil.SetControllerReference(owner, target, r.Scheme) + if err != nil { + return false, err + } + + return true, nil +} + +func (r *CommonResourcesManager) GetPod(ctx context.Context, namespace, name string) (*corev1.Pod, error) { + pod := &corev1.Pod{} + + err := r.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, pod) + if err != nil { + return nil, err + } + + return pod, nil +} + +func (r *CommonResourcesManager) GetService(ctx context.Context, namespace, name string) (*corev1.Service, error) { + svc := &corev1.Service{} + + err := r.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, svc) + if err != nil { + return nil, err + } + + return svc, nil +} + +func (r *CommonResourcesManager) ListStatefulSets(ctx context.Context, namespace string, selector labels.Selector) (*appsv1.StatefulSetList, error) { + stsList := &appsv1.StatefulSetList{} + + err := r.List(ctx, stsList, &client.ListOptions{LabelSelector: selector, Namespace: namespace}) + if err != nil { + return nil, err + } + + return stsList, nil +} + +func (r *CommonResourcesManager) ListPods(ctx context.Context, namespace string, selector labels.Selector) (*corev1.PodList, error) { + podList := &corev1.PodList{} + + err := r.List(ctx, podList, &client.ListOptions{LabelSelector: selector, Namespace: namespace}) + if err != nil { + return nil, err + } + + return podList, nil +} + +func (r *CommonResourcesManager) GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) { + cfgMap := &corev1.ConfigMap{} + + err := r.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, cfgMap) + if err != nil { + return nil, err + } + + return cfgMap, nil +} + +func (r *CommonResourcesManager) GetConfigMapValue(ctx context.Context, ns, name, key string) (string, error) { + cfg, err := r.GetConfigMap(ctx, ns, name) + if err != nil { + return "", err + } + + return cfg.Data[key], nil +} + +func (r *CommonResourcesManager) GetSecret(ctx context.Context, ns, name string) (*corev1.Secret, error) { + secret := &corev1.Secret{} + + err := r.Get(ctx, types.NamespacedName{Namespace: ns, Name: name}, secret) + if err != nil { + return nil, err + } + + return secret, nil +} + +func (r *CommonResourcesManager) GetSecretValue(ctx context.Context, ns, name, key string) (string, error) { + secret, err := r.GetSecret(ctx, ns, name) + if err != nil { + return "", err + } + + return string(secret.Data[key]), nil +} diff --git a/pkg/reconciliation/aliases.go b/pkg/reconciliation/aliases.go new file mode 100644 index 00000000..3e35ec77 --- /dev/null +++ b/pkg/reconciliation/aliases.go @@ -0,0 +1,35 @@ +package reconciliation + +import ( + "time" + + ctrl "sigs.k8s.io/controller-runtime" +) + +type ( + Manager = ctrl.Manager + Result = ctrl.Result + Request = ctrl.Request +) + +var NewControllerManagedBy = ctrl.NewControllerManagedBy + +func Requeue(requeueTime time.Duration) (*Result, error) { + return &ctrl.Result{RequeueAfter: requeueTime}, nil +} + +func Error(err error) (*Result, error) { + return nil, err +} + +func Break(err error) (*Result, error) { + return &Result{}, err +} + +func NextStep() (*Result, error) { + return nil, nil +} + +func Complete() (*Result, error) { + return &Result{}, nil +} diff --git a/pkg/reconciliation/cartridge_config_context.go b/pkg/reconciliation/cartridge_config_context.go new file mode 100644 index 00000000..9fb108dc --- /dev/null +++ b/pkg/reconciliation/cartridge_config_context.go @@ -0,0 +1,12 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" +) + +type CartridgeConfigContext[ConfigType api.CartridgeConfig] interface { + Context + + SetCartridgeConfig(config ConfigType) + GetCartridgeConfig() ConfigType +} diff --git a/pkg/reconciliation/cartridge_config_controller.go b/pkg/reconciliation/cartridge_config_controller.go new file mode 100644 index 00000000..78d436e8 --- /dev/null +++ b/pkg/reconciliation/cartridge_config_controller.go @@ -0,0 +1,9 @@ +package reconciliation + +type CartridgeConfigController interface { + Controller +} + +type CommonCartridgeConfigController struct { + *CommonController +} diff --git a/pkg/reconciliation/cluster_context.go b/pkg/reconciliation/cluster_context.go new file mode 100644 index 00000000..3eb61e9b --- /dev/null +++ b/pkg/reconciliation/cluster_context.go @@ -0,0 +1,12 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" +) + +type ClusterContext[ClusterType api.Cluster] interface { + Context + + SetCluster(cluster ClusterType) + GetCluster() ClusterType +} diff --git a/pkg/reconciliation/cluster_controller.go b/pkg/reconciliation/cluster_controller.go new file mode 100644 index 00000000..365b4bf4 --- /dev/null +++ b/pkg/reconciliation/cluster_controller.go @@ -0,0 +1,21 @@ +package reconciliation + +import ( + "context" + + "github.com/tarantool/tarantool-operator/pkg/api" +) + +type ClusterController interface { + Controller +} + +type ClusterWithRolesController[RolePhaseType comparable] interface { + ClusterController + + IsAllRolesAtPhase(ctx context.Context, cluster api.Cluster, phase RolePhaseType) (bool, error) +} + +type CommonClusterController struct { + *CommonController +} diff --git a/pkg/reconciliation/common_context.go b/pkg/reconciliation/common_context.go new file mode 100644 index 00000000..cc2af221 --- /dev/null +++ b/pkg/reconciliation/common_context.go @@ -0,0 +1,44 @@ +package reconciliation + +import ( + "context" + + "github.com/go-logr/logr" + "github.com/tarantool/tarantool-operator/pkg/api" + v1 "k8s.io/api/core/v1" + ctrl "sigs.k8s.io/controller-runtime" +) + +type CommonContext struct { + context.Context + + Request ctrl.Request + Logger logr.Logger + + cluster api.Cluster + leader *v1.Pod +} + +func (r *CommonContext) GetRequest() ctrl.Request { + return r.Request +} + +func (r *CommonContext) GetLogger() logr.Logger { + return r.Logger +} + +func (r *CommonContext) SetRelatedCluster(cluster api.Cluster) { + r.cluster = cluster +} + +func (r *CommonContext) GetRelatedCluster() api.Cluster { + return r.cluster +} + +func (r *CommonContext) SetLeader(leader *v1.Pod) { + r.leader = leader +} + +func (r *CommonContext) GetLeader() *v1.Pod { + return r.leader +} diff --git a/pkg/reconciliation/common_controller.go b/pkg/reconciliation/common_controller.go new file mode 100644 index 00000000..d3357a2e --- /dev/null +++ b/pkg/reconciliation/common_controller.go @@ -0,0 +1,45 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "github.com/tarantool/tarantool-operator/pkg/topology" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type CommonController struct { + client.Client + + Schema *runtime.Scheme + LeaderElection *election.LeaderElection + ResourcesManager k8s.ResourcesManager + LabelsManager k8s.LabelsManager + EventsRecorder *events.Recorder + Topology topology.CartridgeTopology +} + +func (r *CommonController) GetLeaderElection() *election.LeaderElection { + return r.LeaderElection +} + +func (r *CommonController) GetResourcesManager() k8s.ResourcesManager { + return r.ResourcesManager +} + +func (r *CommonController) GetLabelsManager() k8s.LabelsManager { + return r.LabelsManager +} + +func (r *CommonController) GetEventsRecorder() *events.Recorder { + return r.EventsRecorder +} + +func (r *CommonController) GetScheme() *runtime.Scheme { + return r.Schema +} + +func (r *CommonController) GetTopology() topology.CartridgeTopology { + return r.Topology +} diff --git a/pkg/reconciliation/context.go b/pkg/reconciliation/context.go new file mode 100644 index 00000000..a72b786d --- /dev/null +++ b/pkg/reconciliation/context.go @@ -0,0 +1,29 @@ +package reconciliation + +import ( + "context" + + "github.com/go-logr/logr" + "github.com/tarantool/tarantool-operator/pkg/api" + v1 "k8s.io/api/core/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Context interface { + context.Context + + GetLogger() logr.Logger + + GetRequest() ctrl.Request + + SetRelatedCluster(cluster api.Cluster) + GetRelatedCluster() api.Cluster + + SetLeader(leader *v1.Pod) + GetLeader() *v1.Pod + + HasRequestedObject() bool + SetRequestedObject(obj client.Object) error + GetRequestedObject() client.Object +} diff --git a/pkg/reconciliation/controller.go b/pkg/reconciliation/controller.go new file mode 100644 index 00000000..c950585c --- /dev/null +++ b/pkg/reconciliation/controller.go @@ -0,0 +1,21 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/election" + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/k8s" + "github.com/tarantool/tarantool-operator/pkg/topology" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Controller interface { + client.Client + + GetScheme() *runtime.Scheme + GetLeaderElection() *election.LeaderElection + GetResourcesManager() k8s.ResourcesManager + GetLabelsManager() k8s.LabelsManager + GetEventsRecorder() *events.Recorder + GetTopology() topology.CartridgeTopology +} diff --git a/pkg/reconciliation/reconciler.go b/pkg/reconciliation/reconciler.go new file mode 100644 index 00000000..664e87e1 --- /dev/null +++ b/pkg/reconciliation/reconciler.go @@ -0,0 +1,76 @@ +package reconciliation + +import ( + "fmt" + "time" + + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + ErrorTimeout = 10 * time.Second + SteppedReconcilerVerbosityLevel = 1 +) + +type SteppedReconciler[CtxType Context, CtrlType Controller] struct { + client.Client + + Controller CtrlType +} + +func (r *SteppedReconciler[CtxType, CtrlType]) Run(ctx CtxType, steps ...Step[CtxType, CtrlType]) (ctrl.Result, error) { + var ( + res *ctrl.Result + err error + lastStep string + ) + + for _, step := range steps { + lastStep = step.GetName() + + ctx.GetLogger().V(SteppedReconcilerVerbosityLevel).Info(fmt.Sprintf("Execute `%s` step", step.GetName())) + res, err = step.Reconcile(ctx, r.Controller) + + if err != nil || res != nil { + break + } + } + + updErr := r.UpdateStatus(ctx) + if updErr != nil { + return ctrl.Result{RequeueAfter: ErrorTimeout}, updErr + } + + if err != nil && res == nil { + res = &ctrl.Result{RequeueAfter: ErrorTimeout} + } + + if res == nil { + res = &ctrl.Result{} + } + + if err != nil { + ctx.GetLogger().V(SteppedReconcilerVerbosityLevel).Error(err, fmt.Sprintf("An error occurred during `%s` step", lastStep)) + } + + if res.Requeue || res.RequeueAfter > 0 { + ctx.GetLogger().V(SteppedReconcilerVerbosityLevel).Info(fmt.Sprintf("Requeue at `%s` step", lastStep)) + } else { + ctx.GetLogger().V(SteppedReconcilerVerbosityLevel).Info(fmt.Sprintf("Finish cycle at `%s` step", lastStep)) + } + + return *res, err +} + +func (r *SteppedReconciler[CtxType, CtrlType]) UpdateStatus(ctx CtxType) error { + if ctx.HasRequestedObject() { + obj := ctx.GetRequestedObject() + + if obj.GetDeletionTimestamp() == nil || len(obj.GetFinalizers()) > 0 { + return r.Status().Update(ctx, obj) + } + } + + return nil +} diff --git a/pkg/reconciliation/role_context.go b/pkg/reconciliation/role_context.go new file mode 100644 index 00000000..0b9ad625 --- /dev/null +++ b/pkg/reconciliation/role_context.go @@ -0,0 +1,12 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" +) + +type RoleContext[RoleType api.Role] interface { + Context + + SetRole(role RoleType) + GetRole() RoleType +} diff --git a/pkg/reconciliation/role_controller.go b/pkg/reconciliation/role_controller.go new file mode 100644 index 00000000..77c3784d --- /dev/null +++ b/pkg/reconciliation/role_controller.go @@ -0,0 +1,16 @@ +package reconciliation + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + "github.com/tarantool/tarantool-operator/pkg/k8s" +) + +type RoleController[RoleType api.Role] interface { + Controller + + GetReplicasetsManger() k8s.ReplicasetsManger[RoleType] +} + +type CommonRoleController struct { + *CommonController +} diff --git a/pkg/reconciliation/steps.go b/pkg/reconciliation/steps.go new file mode 100644 index 00000000..aee4c8d9 --- /dev/null +++ b/pkg/reconciliation/steps.go @@ -0,0 +1,8 @@ +package reconciliation + +import ctrl "sigs.k8s.io/controller-runtime" + +type Step[CtxType Context, CtrlType Controller] interface { + GetName() string + Reconcile(ctx CtxType, ctrl CtrlType) (*ctrl.Result, error) +} diff --git a/pkg/reconciliation/steps/cartridge/configure.go b/pkg/reconciliation/steps/cartridge/configure.go new file mode 100644 index 00000000..5a36aad0 --- /dev/null +++ b/pkg/reconciliation/steps/cartridge/configure.go @@ -0,0 +1,43 @@ +package cartridge + +import ( + "github.com/google/go-cmp/cmp" + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "gopkg.in/yaml.v3" +) + +type ConfigureStep[ConfigType api.CartridgeConfig, CtxType CartridgeConfigContext[ConfigType], CtrlType CartridgeConfigController] struct{} + +func (r *ConfigureStep[ConfigType, CtxType, CtrlType]) GetName() string { + return "Configure cartridge" +} + +func (r *ConfigureStep[ConfigType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + actualConfig, err := ctrl.GetTopology().GetCartridgeConfig(ctx, ctx.GetLeader()) + if err != nil { + return Error(err) + } + + var desiredConfig map[string]interface{} + + err = yaml.Unmarshal(ctx.GetCartridgeConfig().GetData(), &desiredConfig) + if err != nil { + return Error(err) + } + + if cmp.Equal(actualConfig, desiredConfig) { + ctx.GetLogger().Info("Configs are equals do not upload") + + return Error(err) + } + + err = ctrl.GetTopology().ApplyCartridgeConfig(ctx, ctx.GetLeader(), desiredConfig) + if err != nil { + ctx.GetLogger().Error(err, "Unable to apply cartridge config") + + return Error(err) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cartridge/reset_status.go b/pkg/reconciliation/steps/cartridge/reset_status.go new file mode 100644 index 00000000..95a3a315 --- /dev/null +++ b/pkg/reconciliation/steps/cartridge/reset_status.go @@ -0,0 +1,18 @@ +package cartridge + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type ResetStatusStep[ConfigType api.CartridgeConfig, CtxType CartridgeConfigContext[ConfigType], CtrlType CartridgeConfigController] struct{} + +func (r *ResetStatusStep[ConfigType, CtxType, CtrlType]) GetName() string { + return "Reset cartridge config status" +} + +func (r *ResetStatusStep[ConfigType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetCartridgeConfig().ResetStatus() + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cartridge/set_phase.go b/pkg/reconciliation/steps/cartridge/set_phase.go new file mode 100644 index 00000000..1e702586 --- /dev/null +++ b/pkg/reconciliation/steps/cartridge/set_phase.go @@ -0,0 +1,20 @@ +package cartridge + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type SetPhaseStep[PhaseType comparable, ConfigType api.CartridgeConfigWithStatus[PhaseType], CtxType CartridgeConfigContext[ConfigType], CtrlType CartridgeConfigController] struct { + Phase PhaseType +} + +func (r *SetPhaseStep[PhaseType, ConfigType, CtxType, CtrlType]) GetName() string { + return "Set cartridge config phase" +} + +func (r *SetPhaseStep[PhaseType, ConfigType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetCartridgeConfig().SetPhase(r.Phase) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/bootstrap.go b/pkg/reconciliation/steps/cluster/bootstrap.go new file mode 100644 index 00000000..686d0028 --- /dev/null +++ b/pkg/reconciliation/steps/cluster/bootstrap.go @@ -0,0 +1,45 @@ +package cluster + +import ( + "strings" + + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type BootstrapStep[ + PhaseType comparable, + ClusterType api.ClusterWithStatus[PhaseType], + CtxType ClusterContext[ClusterType], + CtrlType ClusterController, +] struct { + ErrorPhase PhaseType +} + +func (r *BootstrapStep[PhaseType, ClusterType, CtxType, CtrlType]) GetName() string { + return "Bootstrap vshard" +} + +func (r *BootstrapStep[PhaseType, ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + if ctx.GetCluster().IsBootstrapped() { + return NextStep() + } + + err := ctrl.GetTopology().BootstrapVshard(ctx, ctx.GetLeader()) + if err != nil { + if strings.Contains(err.Error(), "No remotes with role \"vshard-router\" available") || + strings.Contains(err.Error(), "No remotes with role \"vshard-storage\" available") { + ctrl.GetEventsRecorder().Event(ctx.GetCluster(), NewUnableToBootstrapEvent(err)) + ctx.GetCluster().SetPhase(r.ErrorPhase) + + return Complete() + } + + return Error(err) + } + + ctx.GetCluster().MarkBootstrapped() + ctrl.GetEventsRecorder().Event(ctx.GetCluster(), NewBootstrappedEvent()) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/check_deletion.go b/pkg/reconciliation/steps/cluster/check_deletion.go new file mode 100644 index 00000000..ccc94c1e --- /dev/null +++ b/pkg/reconciliation/steps/cluster/check_deletion.go @@ -0,0 +1,20 @@ +package cluster + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type CheckDeletionStep[ClusterType api.Cluster, CtxType ClusterContext[ClusterType], CtrlType ClusterController] struct{} + +func (r *CheckDeletionStep[ClusterType, CtxType, CtrlType]) GetName() string { + return "Check cluster deletion" +} + +func (r *CheckDeletionStep[ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + if ctx.GetCluster().GetDeletionTimestamp() != nil { + return Complete() + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/conifgure_failover.go b/pkg/reconciliation/steps/cluster/conifgure_failover.go new file mode 100644 index 00000000..0888603d --- /dev/null +++ b/pkg/reconciliation/steps/cluster/conifgure_failover.go @@ -0,0 +1,126 @@ +package cluster + +import ( + "github.com/google/go-cmp/cmp" + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "github.com/tarantool/tarantool-operator/pkg/topology" +) + +type ConfigureFailoverStep[ClusterType api.Cluster, CtxType ClusterContext[ClusterType], CtrlType ClusterController] struct{} + +func (r *ConfigureFailoverStep[ClusterType, CtxType, CtrlType]) GetName() string { + return "Configure failover" +} + +func (r *ConfigureFailoverStep[ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + config := ctx.GetCluster().GetFailoverConfig() + if config == nil { + return NextStep() + } + + params, err := r.LoadFailoverParams(ctx, ctrl) + if err != nil { + ctx.GetLogger().Error(err, "failed to enable cluster failover, unable to retrieve params") + + return Error(err) + } + + currentParams, err := ctrl.GetTopology().GetFailoverParams(ctx, ctx.GetLeader()) + if err != nil { + ctx.GetLogger().Error( + err, + "failed to enable cluster failover, unable to retrieve current params", + ) + + return Error(err) + } + + if cmp.Equal(params, currentParams) { + ctx.GetLogger().Info("failover has same configuration, not retrying") + + return NextStep() + } + + if err = ctrl.GetTopology().SetFailoverParams(ctx, ctx.GetLeader(), params); err != nil { + ctx.GetLogger().Error(err, "failed to enable cluster failover") + + return Error(err) + } + + ctx.GetLogger().Info("failover enabled") + + return NextStep() +} + +func (r *ConfigureFailoverStep[ClusterType, CtxType, CtrlType]) LoadFailoverParams(ctx CtxType, ctrl CtrlType) (*topology.FailoverParams, error) { + config := ctx.GetCluster().GetFailoverConfig() + params := &topology.FailoverParams{ + Mode: config.GetMode(), + Timeout: config.GetTimeout(), + StateProvider: config.GetStateProvider(), + FencingEnabled: config.GetFencing(), + FencingTimeout: config.GetFencingTimeout(), + FencingPause: config.GetFencingPause(), + } + + if config.GetMode() == api.FailoverModeStateful { + switch config.GetStateProvider() { + case api.FailoverStateProviderETCD2: + var ( + etcd2Password string + err error + ) + + etcd2config := config.GetETCD2Config() + etcd2PasswordRef := etcd2config.GetPassword() + + if etcd2PasswordRef.Name != "" { + etcd2Password, err = ctrl.GetResourcesManager().GetSecretValue( + ctx, + etcd2PasswordRef.Namespace, + etcd2PasswordRef.Name, + "etcd2-password", // fixme: make not hardcoded + ) + if err != nil { + return nil, err + } + } + + params.Etcd2Params = &topology.Etcd2Params{ + Endpoints: etcd2config.GetEndpoints(), + Username: etcd2config.GetUsername(), + Password: etcd2Password, + LockDelay: etcd2config.GetLockDelay(), + Prefix: etcd2config.GetPrefix(), + } + case api.FailoverStateProviderStateboard: + var ( + stateboardPassword string + err error + ) + + stateboardConfig := config.GetStateboardConfig() + stateboardPasswordRef := stateboardConfig.GetPassword() + + if stateboardPasswordRef.Name != "" { + stateboardPassword, err = ctrl.GetResourcesManager().GetSecretValue( + ctx, + stateboardPasswordRef.Namespace, + stateboardPasswordRef.Name, + "stateboard-password", // fixme: make not hardcoded + ) + if err != nil { + return nil, err + } + } + + params.StateboardParams = &topology.StateboardParams{ + URI: stateboardConfig.GetURI(), + Password: stateboardPassword, + } + } + } + + return params, nil +} diff --git a/pkg/reconciliation/steps/cluster/events.go b/pkg/reconciliation/steps/cluster/events.go new file mode 100644 index 00000000..5f9d87fa --- /dev/null +++ b/pkg/reconciliation/steps/cluster/events.go @@ -0,0 +1,27 @@ +package cluster + +import ( + "github.com/tarantool/tarantool-operator/pkg/events" + corev1 "k8s.io/api/core/v1" +) + +const ( + EventUnableToBootstrap = "UnableToBootstrap" + EventBootstrapped = "Bootstrapped" +) + +func NewUnableToBootstrapEvent(err error) *events.Event { + return &events.Event{ + EventType: corev1.EventTypeWarning, + Reason: EventUnableToBootstrap, + Message: err.Error(), + } +} + +func NewBootstrappedEvent() *events.Event { + return &events.Event{ + EventType: corev1.EventTypeNormal, + Reason: EventBootstrapped, + Message: "Bootstrapped successfully.", + } +} diff --git a/pkg/reconciliation/steps/cluster/reset_status.go b/pkg/reconciliation/steps/cluster/reset_status.go new file mode 100644 index 00000000..00be3ca2 --- /dev/null +++ b/pkg/reconciliation/steps/cluster/reset_status.go @@ -0,0 +1,18 @@ +package cluster + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type ResetStatusStep[ClusterType api.Cluster, CtxType ClusterContext[ClusterType], CtrlType ClusterController] struct{} + +func (r *ResetStatusStep[ClusterType, CtxType, CtrlType]) GetName() string { + return "Reset cluster status" +} + +func (r *ResetStatusStep[ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetCluster().ResetStatus() + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/set_phase.go b/pkg/reconciliation/steps/cluster/set_phase.go new file mode 100644 index 00000000..8e0c4c27 --- /dev/null +++ b/pkg/reconciliation/steps/cluster/set_phase.go @@ -0,0 +1,20 @@ +package cluster + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type SetPhaseStep[PhaseType comparable, ClusterType api.ClusterWithStatus[PhaseType], CtxType ClusterContext[ClusterType], CtrlType ClusterController] struct { + Phase PhaseType +} + +func (r *SetPhaseStep[PhaseType, ClusterType, CtxType, CtrlType]) GetName() string { + return "Set cluster phase" +} + +func (r *SetPhaseStep[PhaseType, ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetCluster().SetPhase(r.Phase) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/sync_cluster_wide_service.go b/pkg/reconciliation/steps/cluster/sync_cluster_wide_service.go new file mode 100644 index 00000000..9e707a3e --- /dev/null +++ b/pkg/reconciliation/steps/cluster/sync_cluster_wide_service.go @@ -0,0 +1,91 @@ +package cluster + +import ( + "github.com/google/go-cmp/cmp" + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type SyncClusterWideServiceStep[ClusterType api.Cluster, CtxType ClusterContext[ClusterType], CtrlType ClusterController] struct { + Phase string +} + +func (r *SyncClusterWideServiceStep[ClusterType, CtxType, CtrlType]) GetName() string { + return "Sync cluster-wide service" +} + +func (r *SyncClusterWideServiceStep[ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + ctx.GetLogger().Info("SyncClusterWideServiceStep") + + cluster := ctx.GetCluster() + + saveFunc := ctrl.GetResourcesManager().UpdateObject + + svc, err := ctrl.GetResourcesManager().GetService(ctx, cluster.GetNamespace(), cluster.GetName()) + if err != nil { + if !apierrors.IsNotFound(err) { + return Error(err) + } + + saveFunc = ctrl.GetResourcesManager().CreateObject + svc = &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: cluster.GetName(), + Namespace: cluster.GetNamespace(), + }, + } + } + + changed, err := ctrl.GetResourcesManager().ControlObject(cluster, svc) + if err != nil { + return Error(err) + } + + selector := map[string]string{ + ctrl.GetLabelsManager().ClusterName(): cluster.GetName(), + } + if !cmp.Equal(svc.Spec.Selector, selector) { + svc.Spec.Selector = selector + changed = true + } + + if !svc.Spec.PublishNotReadyAddresses { + svc.Spec.PublishNotReadyAddresses = true + changed = true + } + + if svc.Spec.ClusterIP != "None" { + svc.Spec.ClusterIP = "None" + changed = true + } + + ports := []corev1.ServicePort{ + { + Name: "app", + Port: cluster.GetListenPort(), + Protocol: "TCP", + }, + { + Name: "app-udp", + Port: cluster.GetListenPort(), + Protocol: "UDP", + }, + } + + if !cmp.Equal(svc.Spec.Ports, ports) { + svc.Spec.Ports = ports + changed = true + } + + if changed { + err = saveFunc(ctx, svc) + if err != nil { + return Error(err) + } + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/cluster/wait_for_roles_phase.go b/pkg/reconciliation/steps/cluster/wait_for_roles_phase.go new file mode 100644 index 00000000..49d88877 --- /dev/null +++ b/pkg/reconciliation/steps/cluster/wait_for_roles_phase.go @@ -0,0 +1,34 @@ +package cluster + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type WaitForRolesPhaseStep[ + RolePhaseType comparable, + ClusterType api.Cluster, + CtxType ClusterContext[ClusterType], + CtrlType ClusterWithRolesController[RolePhaseType], +] struct { + ExpectedPhases []RolePhaseType +} + +func (r *WaitForRolesPhaseStep[RolePhaseType, ClusterType, CtxType, CtrlType]) GetName() string { + return "Wait roles to be in phase" +} + +func (r *WaitForRolesPhaseStep[RolePhaseType, ClusterType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + for _, expectedPhase := range r.ExpectedPhases { + allRolesAtCorrectPhase, err := ctrl.IsAllRolesAtPhase(ctx, ctx.GetCluster(), expectedPhase) + if err != nil { + return Error(err) + } + + if allRolesAtCorrectPhase { + return NextStep() + } + } + + return Complete() +} diff --git a/pkg/reconciliation/steps/common/get_cluster_by_labels.go b/pkg/reconciliation/steps/common/get_cluster_by_labels.go new file mode 100644 index 00000000..8af90080 --- /dev/null +++ b/pkg/reconciliation/steps/common/get_cluster_by_labels.go @@ -0,0 +1,54 @@ +package common + +import ( + "fmt" + "time" + + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + apiErrors "k8s.io/apimachinery/pkg/api/errors" +) + +func GetClusterByLabels[CtxType Context, CtrlType Controller]() *GetClusterByLabelsStep[CtxType, CtrlType] { + return &GetClusterByLabelsStep[CtxType, CtrlType]{} +} + +type GetClusterByLabelsStep[CtxType Context, CtrlType Controller] struct{} + +func (r *GetClusterByLabelsStep[CtxType, CtrlType]) GetName() string { + return "Get cluster by labels" +} + +func (r *GetClusterByLabelsStep[CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + if ctx.GetRelatedCluster() != nil { + return NextStep() + } + + object := ctx.GetRequestedObject() + objectLabels := object.GetLabels() + + if objectLabels == nil { + return Break(fmt.Errorf(" %s label is required", ctrl.GetLabelsManager().ClusterName())) + } + + clusterName, ok := objectLabels[ctrl.GetLabelsManager().ClusterName()] + if !ok || clusterName == "" { + return Break(fmt.Errorf(" %s label is required", ctrl.GetLabelsManager().ClusterName())) + } + + cluster, err := ctrl.GetResourcesManager().GetCluster(ctx, object.GetNamespace(), clusterName) + if err != nil { + return Error(err) + } + + if err != nil { + if apiErrors.IsNotFound(err) { + return Requeue(10 * time.Second) + } + + return Error(err) + } + + ctx.SetRelatedCluster(cluster) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/common/get_leader.go b/pkg/reconciliation/steps/common/get_leader.go new file mode 100644 index 00000000..3d74c45f --- /dev/null +++ b/pkg/reconciliation/steps/common/get_leader.go @@ -0,0 +1,40 @@ +package common + +import ( + "time" + + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/pkg/election" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +func GetLeader[CtxType Context, CtrlType Controller]() *GetLeaderStep[CtxType, CtrlType] { + return &GetLeaderStep[CtxType, CtrlType]{} +} + +type GetLeaderStep[CtxType Context, CtrlType Controller] struct { + Message string +} + +func (r *GetLeaderStep[CtxType, CtrlType]) GetName() string { + return "Get leader" +} + +func (r *GetLeaderStep[CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + leader, err := ctrl.GetLeaderElection().GetLeaderInstance(ctx, ctx.GetRelatedCluster()) + if err != nil { + if errors.Is(err, election.ErrLeaderElectionConflict) { + return Requeue(time.Second * 10) + } + + if errors.Is(err, election.ErrNoAvailableLeader) && !ctx.GetRelatedCluster().IsBootstrapped() { + return Requeue(time.Second * 10) + } + + return Error(err) + } + + ctx.SetLeader(leader) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/common/get_requested_object.go b/pkg/reconciliation/steps/common/get_requested_object.go new file mode 100644 index 00000000..10d4b725 --- /dev/null +++ b/pkg/reconciliation/steps/common/get_requested_object.go @@ -0,0 +1,40 @@ +package common + +import ( + "github.com/pkg/errors" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func GetRequestedObject[CtxType Context, CtrlType Controller](target client.Object) *GetRequestedObjectStep[CtxType, CtrlType] { + return &GetRequestedObjectStep[CtxType, CtrlType]{ + Target: target, + } +} + +type GetRequestedObjectStep[CtxType Context, CtrlType Controller] struct { + Target client.Object +} + +func (r *GetRequestedObjectStep[CtxType, CtrlType]) GetName() string { + return "Get requested object" +} + +func (r *GetRequestedObjectStep[CtxType, CtrlType]) Reconcile(ctx CtxType, controller CtrlType) (*Result, error) { + err := controller.Get(ctx, ctx.GetRequest().NamespacedName, r.Target) + if err != nil { + if !apiErrors.IsNotFound(err) { + return nil, errors.Wrap(err, "unable to retrieve object for reconcile") + } + + return Complete() + } + + err = ctx.SetRequestedObject(r.Target) + if err != nil { + return Error(err) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/common/info.go b/pkg/reconciliation/steps/common/info.go new file mode 100644 index 00000000..6b3ace5e --- /dev/null +++ b/pkg/reconciliation/steps/common/info.go @@ -0,0 +1,25 @@ +package common + +import ( + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +func Info[CtxType Context, CtrlType Controller](message string) *InfoStep[CtxType, CtrlType] { + return &InfoStep[CtxType, CtrlType]{ + Message: message, + } +} + +type InfoStep[CtxType Context, CtrlType Controller] struct { + Message string +} + +func (r *InfoStep[CtxType, CtrlType]) GetName() string { + return "Print info" +} + +func (r *InfoStep[CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetLogger().Info(r.Message) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/common/wait_for_cluster_bootstrapped.go b/pkg/reconciliation/steps/common/wait_for_cluster_bootstrapped.go new file mode 100644 index 00000000..0839e1ce --- /dev/null +++ b/pkg/reconciliation/steps/common/wait_for_cluster_bootstrapped.go @@ -0,0 +1,26 @@ +package common + +import ( + "time" + + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +func WaitForClusterBootstrapped[CtxType Context, CtrlType Controller]() *WaitForClusterBootstrappedStep[CtxType, CtrlType] { + return &WaitForClusterBootstrappedStep[CtxType, CtrlType]{} +} + +type WaitForClusterBootstrappedStep[CtxType Context, CtrlType Controller] struct{} + +func (r *WaitForClusterBootstrappedStep[CtxType, CtrlType]) GetName() string { + return "Wait cluster to be bootstrapped" +} + +func (r *WaitForClusterBootstrappedStep[CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + cluster := ctx.GetRelatedCluster() + if cluster == nil || !cluster.IsBootstrapped() { + return Requeue(10 * time.Second) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/configure_vshard_roles.go b/pkg/reconciliation/steps/role/configure_vshard_roles.go new file mode 100644 index 00000000..6cf9742e --- /dev/null +++ b/pkg/reconciliation/steps/role/configure_vshard_roles.go @@ -0,0 +1,77 @@ +package role + +import ( + "time" + + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "github.com/tarantool/tarantool-operator/pkg/utils" +) + +type ConfigureVShardRolesStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *ConfigureVShardRolesStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Check role orphan deletion" +} + +func (r *ConfigureVShardRolesStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + role := ctx.GetRole() + topologyClient := ctrl.GetTopology() + + allRolesConfigured := true + + for stsOrdinal := int32(0); stsOrdinal < role.GetReplicasets(); stsOrdinal++ { + stsList, err := ctrl.GetResourcesManager().ListStatefulSets( + ctx, + role.GetNamespace(), + ctrl.GetLabelsManager().SelectorByReplicasetOrdinal(role, stsOrdinal), + ) + if err != nil { + allRolesConfigured = false + + continue + } + + for _, sts := range stsList.Items { + if sts.GetDeletionTimestamp() != nil { + continue + } + + hierarchy, err := topologyClient.GetRolesHierarchy(ctx, ctx.GetLeader()) + if err != nil { + allRolesConfigured = false + + continue + } + + replicasetUUID := ctrl.GetReplicasetsManger().GetReplicasetUUID(role, stsOrdinal) + + actualRoles, err := topologyClient.GetReplicasetRoles(ctx, ctx.GetLeader(), replicasetUUID) + if err != nil { + allRolesConfigured = false + + continue + } + + vshardConfig := role.GetVShardConfig() + desiredRoles := vshardConfig.GetRoles() + + if !utils.IsVShardRolesEquals(actualRoles, desiredRoles, hierarchy) { + err = topologyClient.SetReplicasetRoles(ctx, ctx.GetLeader(), replicasetUUID, vshardConfig.GetRoles()) + if err != nil { + allRolesConfigured = false + + continue + } + } + } + } + + if !allRolesConfigured { + ctx.GetLogger().Info("Not all vshard roles configured") + + return Requeue(10 * time.Second) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/create_stateful_sets.go b/pkg/reconciliation/steps/role/create_stateful_sets.go new file mode 100644 index 00000000..c36bf2c5 --- /dev/null +++ b/pkg/reconciliation/steps/role/create_stateful_sets.go @@ -0,0 +1,28 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type CreateStatefulSetsStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *CreateStatefulSetsStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Create StatefulSets" +} + +func (r *CreateStatefulSetsStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + role := ctx.GetRole() + cluster := ctx.GetRelatedCluster() + + if ctx.GetRole().GetDeletionTimestamp() != nil { + return NextStep() + } + + err := ctrl.GetReplicasetsManger().CreateStatefulSets(ctx, cluster, role) + if err != nil { + return Error(err) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/ensure_cartridge_ready.go b/pkg/reconciliation/steps/role/ensure_cartridge_ready.go new file mode 100644 index 00000000..4cdc0e77 --- /dev/null +++ b/pkg/reconciliation/steps/role/ensure_cartridge_ready.go @@ -0,0 +1,57 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "github.com/tarantool/tarantool-operator/pkg/utils" +) + +type EnsureCartridgeReadyStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *EnsureCartridgeReadyStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Ensure cartridge ready" +} + +func (r *EnsureCartridgeReadyStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + allPodsRunning, err := r.IsCartridgeReady(ctx, ctrl) + if err != nil || !allPodsRunning { + ctx.GetLogger().Info("Not all pods of role are running. Wait for it.") + + return Error(err) + } + + return NextStep() +} + +func (r *EnsureCartridgeReadyStep[RoleType, CtxType, CtrlType]) IsCartridgeReady(ctx CtxType, ctrl CtrlType) (bool, error) { + cluster := ctx.GetRelatedCluster() + role := ctx.GetRole() + + selector := ctrl.GetLabelsManager().SelectorByRoleName(role) + + pods, err := ctrl.GetResourcesManager().ListPods(ctx, cluster.GetNamespace(), selector) + if err != nil { + return false, err + } + + expectedCount := role.GetReplicasets() * role.GetReplicas() + if expectedCount > int32(len(pods.Items)) { + return false, nil + } + + readyCount := int32(0) + + for key := range pods.Items { + if utils.IsPodDeleting(&pods.Items[key]) { + continue + } + + if !utils.IsPodDefaultContainerReady(&pods.Items[key]) { + continue + } + + readyCount++ + } + + return readyCount >= expectedCount, nil +} diff --git a/pkg/reconciliation/steps/role/events.go b/pkg/reconciliation/steps/role/events.go new file mode 100644 index 00000000..a0493e99 --- /dev/null +++ b/pkg/reconciliation/steps/role/events.go @@ -0,0 +1,19 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/events" + "github.com/tarantool/tarantool-operator/pkg/topology" + corev1 "k8s.io/api/core/v1" +) + +const ( + EventTypeWrongVShardRoles = "WrongVShardRoles" +) + +func NewWrongVShardRolesEvent(err *topology.UnknownRoleError) *events.Event { + return &events.Event{ + EventType: corev1.EventTypeWarning, + Reason: EventTypeWrongVShardRoles, + Message: err.Error(), + } +} diff --git a/pkg/reconciliation/steps/role/join_instances.go b/pkg/reconciliation/steps/role/join_instances.go new file mode 100644 index 00000000..b743afa6 --- /dev/null +++ b/pkg/reconciliation/steps/role/join_instances.go @@ -0,0 +1,122 @@ +package role + +import ( + "time" + + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + "github.com/tarantool/tarantool-operator/pkg/topology" + "github.com/tarantool/tarantool-operator/pkg/utils" + v1 "k8s.io/api/core/v1" + apiErrors "k8s.io/apimachinery/pkg/api/errors" +) + +type JoinInstancesStep[ + PhaseType comparable, + RoleType api.RoleWithStatus[PhaseType], + CtxType RoleContext[RoleType], + CtrlType RoleController[RoleType], +] struct { + ConfigErrorPhase PhaseType +} + +func (r *JoinInstancesStep[PhaseType, RoleType, CtxType, CtrlType]) GetName() string { + return "Join instances" +} + +func (r *JoinInstancesStep[PhaseType, RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + role := ctx.GetRole() + cluster := ctx.GetRelatedCluster() + + topologyClient := ctrl.GetTopology() + allJoined := true + + var pod *v1.Pod + + for stsOrdinal := int32(0); stsOrdinal < role.GetReplicasets(); stsOrdinal++ { + selector := ctrl.GetLabelsManager().SelectorByReplicasetOrdinal(role, stsOrdinal) + + stsList, err := ctrl.GetResourcesManager().ListStatefulSets(ctx, role.GetNamespace(), selector) + if err != nil { + return Error(err) + } + + for key := range stsList.Items { + sts := &stsList.Items[key] + if sts.GetDeletionTimestamp() != nil { + continue + } + + for podOrdinal := int32(0); podOrdinal < role.GetReplicas(); podOrdinal++ { + podName := utils.GetStatefulSetPodName(sts.GetName(), podOrdinal) + + pod, err = ctrl.GetResourcesManager().GetPod(ctx, role.GetNamespace(), podName) + if err != nil { + if !apiErrors.IsNotFound(err) { + return Error(err) + } + + allJoined = false + + continue + } + + if !utils.IsPodRunning(pod) || !utils.IsPodDefaultContainerReady(pod) { + allJoined = false + + continue + } + + instanceUUID, uuidErr := topologyClient.GetInstanceUUID(ctx, pod) + if uuidErr != nil { + ctx.GetLogger().Error(uuidErr, "unable to get instance uuid") + + return Error(err) + } + + if instanceUUID == "" { + vshard := role.GetVShardConfig() + + alias, err := role.GetReplicasetName(stsOrdinal) + if uuidErr != nil { + return Error(err) + } + + joinErr := topologyClient.Join( + ctx, + ctx.GetLeader(), + alias, + ctrl.GetReplicasetsManger().GetReplicasetUUID(role, stsOrdinal), + vshard.GetRoles(), + vshard.GetWeight(), + vshard.GetGroupName(), + role.IsAllRw(), + ctrl.GetReplicasetsManger().GetAdvertiseURI(cluster, pod), + ) + if joinErr != nil { + ctx.GetLogger().Error(joinErr, "unable to join instance") + + var configErr *topology.UnknownRoleError + if errors.As(joinErr, &configErr) { + ctrl.GetEventsRecorder().Event(role, NewWrongVShardRolesEvent(configErr)) + role.SetPhase(r.ConfigErrorPhase) + + return Complete() + } + + return Error(err) + } + } + } + } + } + + if !allJoined { + ctx.GetLogger().Info("Not all pods joined tarantool cluster") + + return Requeue(10 * time.Second) + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/reset_status.go b/pkg/reconciliation/steps/role/reset_status.go new file mode 100644 index 00000000..1496e6ef --- /dev/null +++ b/pkg/reconciliation/steps/role/reset_status.go @@ -0,0 +1,19 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" + ctrl "sigs.k8s.io/controller-runtime" +) + +type ResetStatusStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *ResetStatusStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Reset role status" +} + +func (r *ResetStatusStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*ctrl.Result, error) { + ctx.GetRole().ResetStatus() + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/set_phase.go b/pkg/reconciliation/steps/role/set_phase.go new file mode 100644 index 00000000..b0aa4919 --- /dev/null +++ b/pkg/reconciliation/steps/role/set_phase.go @@ -0,0 +1,20 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type SetPhaseStep[PhaseType comparable, RoleType api.RoleWithStatus[PhaseType], CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct { + Phase PhaseType +} + +func (r *SetPhaseStep[PhaseType, RoleType, CtxType, CtrlType]) GetName() string { + return "Set role phase" +} + +func (r *SetPhaseStep[PhaseType, RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, _ CtrlType) (*Result, error) { + ctx.GetRole().SetPhase(r.Phase) + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/set_vshard_weights.go b/pkg/reconciliation/steps/role/set_vshard_weights.go new file mode 100644 index 00000000..62700183 --- /dev/null +++ b/pkg/reconciliation/steps/role/set_vshard_weights.go @@ -0,0 +1,46 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type SetVShardWeightsStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *SetVShardWeightsStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Set vshard weights" +} + +func (r *SetVShardWeightsStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + role := ctx.GetRole() + config := role.GetVShardConfig() + topologyClient := ctrl.GetTopology() + weight := config.GetWeight() + + for i := int32(0); i < role.GetReplicasets(); i++ { + stsList, err := ctrl.GetResourcesManager().ListStatefulSets( + ctx, + role.GetNamespace(), + ctrl.GetLabelsManager().SelectorByReplicasetOrdinal(role, i), + ) + if err != nil { + return Error(err) + } + + for _, sts := range stsList.Items { + if sts.GetDeletionTimestamp() != nil { + continue + } + + stsLabels := sts.GetLabels() + stsUUID := stsLabels[ctrl.GetLabelsManager().ReplicasetUUID()] + + err = topologyClient.SetWeight(ctx, ctx.GetLeader(), stsUUID, weight) + if err != nil { + return Error(err) + } + } + } + + return NextStep() +} diff --git a/pkg/reconciliation/steps/role/update_stateful_sets.go b/pkg/reconciliation/steps/role/update_stateful_sets.go new file mode 100644 index 00000000..62b1bdf5 --- /dev/null +++ b/pkg/reconciliation/steps/role/update_stateful_sets.go @@ -0,0 +1,24 @@ +package role + +import ( + "github.com/tarantool/tarantool-operator/pkg/api" + . "github.com/tarantool/tarantool-operator/pkg/reconciliation" +) + +type UpdateStatefulSetsStep[RoleType api.Role, CtxType RoleContext[RoleType], CtrlType RoleController[RoleType]] struct{} + +func (r *UpdateStatefulSetsStep[RoleType, CtxType, CtrlType]) GetName() string { + return "Update StatefulSets" +} + +func (r *UpdateStatefulSetsStep[RoleType, CtxType, CtrlType]) Reconcile(ctx CtxType, ctrl CtrlType) (*Result, error) { + role := ctx.GetRole() + cluster := ctx.GetRelatedCluster() + + complete, err := ctrl.GetReplicasetsManger().UpdateStatefulSets(ctx, cluster, role) + if err != nil || !complete { + return Error(err) + } + + return NextStep() +} diff --git a/pkg/topology/common.go b/pkg/topology/common.go new file mode 100644 index 00000000..08408e60 --- /dev/null +++ b/pkg/topology/common.go @@ -0,0 +1,398 @@ +package topology + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/pkg/errors" + "github.com/tarantool/tarantool-operator/pkg/topology/transport" + v1 "k8s.io/api/core/v1" +) + +// CommonCartridgeTopology . +type CommonCartridgeTopology struct { + Transport transport.Transport +} + +func (r *CommonCartridgeTopology) Exec(ctx context.Context, instance *v1.Pod, res any, lua string, args ...any) error { + return r.Transport.Exec(ctx, instance, &res, lua, args...) +} + +// Join pod to cluster. +func (r *CommonCartridgeTopology) Join( + ctx context.Context, + leader *v1.Pod, + replicasetAlias string, + replicasetUUID string, + replicasetRoles []string, + replicasetWeight int32, + replicasetVshardGroup string, + replicasetIsAllRw bool, + advertiseURI string, +) error { + editTopology := EditTopologyParams{ + Replicasets: []EditReplicasetParams{ + { + UUID: replicasetUUID, + Alias: replicasetAlias, + Roles: replicasetRoles, + Weight: replicasetWeight, + VShardGroup: replicasetVshardGroup, + AllRw: replicasetIsAllRw, + JoinServers: []JoinServerParams{{ + URI: advertiseURI, + }}, + }, + }, + } + + success, err := r.adminEditTopology(ctx, leader, editTopology) + if err != nil { + var luaErr *LuaError + if errors.As(err, &luaErr) { + if strings.Contains(luaErr.Error(), "is already joined") { + return ErrAlreadyJoined + } + + if strings.Contains(luaErr.Error(), "can not enable unknown role") { + return NewUnknownRoleError(luaErr) + } + } + + return err + } + + if !success { + return ErrTopologyIsDown + } + + return nil +} + +func (r *CommonCartridgeTopology) GetInstanceUUID(ctx context.Context, pod *v1.Pod) (string, error) { + // language=lua + lua := ` + if type(box.cfg) == 'function' then + return "" + end + + return box.info().uuid + ` + + var res string + + err := r.Exec(ctx, pod, &res, lua) + if err != nil { + return "", err + } + + return res, nil +} + +// SetWeight sets weight of a replicaset. +func (r *CommonCartridgeTopology) SetWeight(ctx context.Context, leader *v1.Pod, replicasetUUID string, replicaWeight int32) error { + var res BooleanResult + + // language=lua + lua := ` + local box = require('box') + local cartridge = require('cartridge') + local uuid, weight = ... + + local replicaset = cartridge.admin_get_replicasets(uuid)[1] + local actualWight = 0 + + if replicaset ~= nil and replicaset.weight ~= nil and actualWight ~= box.NULL then + actualWight = replicaset.weight + end + + if replicaset == nil or actualWight ~= weight then + local topology, err = cartridge.admin_edit_topology({ + replicasets = { + { uuid = uuid , weight = weight} + } + }) + if err ~= nil then + return { res=false, err=err} + end + end + + return { res=true ~= nil, err=nil} + ` + + err := r.Exec(ctx, leader, &res, lua, replicasetUUID, replicaWeight) + if err != nil { + return err + } + + if res.Err != nil { + if strings.Contains(res.Err.Error(), "not in config") { + return ErrNotInConfig + } + + if strings.Contains(res.Err.Error(), "At least one vshard-storage (default) must have weight > 0") { + return ErrLastStorageWeight + } + + return res.Err + } + + return nil +} + +// SetReplicasetRoles set roles list of replicaset in the Tarantool service. +func (r *CommonCartridgeTopology) SetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string, roles []string) error { + editTopology := EditTopologyParams{ + Replicasets: []EditReplicasetParams{ + { + UUID: replicasetUUID, + Roles: roles, + }, + }, + } + + success, err := r.adminEditTopology(ctx, leader, editTopology) + if err != nil { + return err + } + + if !success { + return ErrTopologyIsDown + } + + return nil +} + +// GetReplicasetRoles get roles list of replicaset from the Tarantool service. +func (r *CommonCartridgeTopology) GetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string) ([]string, error) { + var res []string + + // language=lua + lua := ` + local args = ... + local cartridge = require('cartridge') + local res = cartridge.admin_get_replicasets(args.uuid) + if res[1] ~= nil then + return res[1].roles + end + return nil + ` + + err := r.Exec(ctx, leader, &res, lua, + GetReplicasetsQuery{ + UUID: replicasetUUID, + }) + if err != nil { + return nil, errors.Wrap(err, "failed to retrieve cartridge replicasets params") + } + + if res == nil { + return []string{}, nil + } + + return res, nil +} + +// BootstrapVshard enable the vshard service on the cluster. +func (r *CommonCartridgeTopology) BootstrapVshard(ctx context.Context, leader *v1.Pod) error { + // language=lua + lua := ` + local cartridge = require('cartridge') + local res, err = cartridge.admin_bootstrap_vshard() + return { res = res, err = err } + ` + + var res BooleanResult + + err := r.Exec(ctx, leader, &res, lua) + if err != nil { + return errors.Wrap(err, "unable to bootstrap cluster") + } + + if res.Err != nil && !isAlreadyBootstrapped(res.Err) { + return errors.Wrap(res.Err, "unable to bootstrap cluster") + } + + return nil +} + +func (r *CommonCartridgeTopology) GetRolesHierarchy(ctx context.Context, leader *v1.Pod) (map[string][]string, error) { + // language=lua + lua := ` + local roles = require('cartridge.roles') + local hierarchy = {} + + for _, roleName in pairs(roles.get_all_roles()) do + hierarchy[roleName] = roles.get_role_dependencies(roleName) + end + + return hierarchy + ` + + var hierarchy map[string][]string + + err := r.Exec(ctx, leader, &hierarchy, lua) + if err != nil { + return nil, errors.Wrap(err, "unable to retrieve roles hierarchy") + } + + return hierarchy, nil +} + +func (r *CommonCartridgeTopology) adminEditTopology(ctx context.Context, leader *v1.Pod, topologyObject EditTopologyParams) (bool, error) { + // language=lua + lua := ` + local args = ... + local cartridge = require('cartridge') + local topology, err = cartridge.admin_edit_topology(args) + return { res = topology ~= nil, err=err } + ` + + var res BooleanResult + + err := r.Exec(ctx, leader, &res, lua, topologyObject) + if err != nil { + return false, errors.Wrap(err, "unable to edit topology") + } + + if res.Err != nil { + return res.Res, errors.Wrap(res.Err, "unable to edit topology") + } + + return res.Res, nil +} + +// SetFailoverParams configures cluster failover. +func (r *CommonCartridgeTopology) SetFailoverParams(ctx context.Context, leader *v1.Pod, params *FailoverParams) error { + var res *BooleanResult + + // language=lua + lua := ` + local cartridge = require('cartridge') + local res, err = cartridge.failover_set_params(...) + + return { res = res, err = err } + ` + + err := r.Exec(ctx, leader, &res, lua, params) + if err != nil { + return err + } + + if res.Err != nil { + return res.Err + } + + return nil +} + +// GetFailoverParams retrieves cluster failover params. +func (r *CommonCartridgeTopology) GetFailoverParams(ctx context.Context, leader *v1.Pod) (*FailoverParams, error) { + var res FailoverParams + + // language=lua + lua := ` + local cartridge = require('cartridge') + return cartridge.failover_get_params() + ` + + err := r.Exec(ctx, leader, &res, lua) + if err != nil { + return nil, errors.Wrap(err, "failed to retrieve cartridge failover params") + } + + return &res, err +} + +func (r *CommonCartridgeTopology) GetCartridgeConfig(ctx context.Context, leader *v1.Pod) (CartridgeConfigData, error) { + // language=lua + lua := ` + local cartridge = require('cartridge') + local cfg = cartridge.config_get_readonly() + local blacklist = { + ['auth'] = true, + ['auth.yml'] = true, + ['topology'] = true, + ['topology.yml'] = true, + ['users_acl'] = true, + ['users_acl.yml'] = true, + ['vshard'] = true, + ['vshard.yml'] = true, + ['vshard_groups'] = true, + ['vshard_groups.yml'] = true, + ['schema.yml'] = true, + } + + local ret = {} + for section, data in pairs(cfg) do + if not blacklist[section] then + ret[section] = data + end + end + return ret + ` + + var ( + res map[string]interface{} + jsonErr *json.UnmarshalTypeError + ) + + err := r.Exec(ctx, leader, &res, lua) + + if errors.As(err, &jsonErr) { + return CartridgeConfigData{}, nil + } + + if err != nil { + return nil, errors.Wrap(err, "failed to download cartridge config") + } + + return res, nil +} + +func (r *CommonCartridgeTopology) ApplyCartridgeConfig(ctx context.Context, leader *v1.Pod, config CartridgeConfigData) error { + // language=lua + lua := ` + local cartridge = require('cartridge') + local blacklist = { + ['auth'] = true, + ['auth.yml'] = true, + ['topology'] = true, + ['topology.yml'] = true, + ['users_acl'] = true, + ['users_acl.yml'] = true, + ['vshard'] = true, + ['vshard.yml'] = true, + ['vshard_groups'] = true, + ['vshard_groups.yml'] = true, + ['schema.yml'] = true, + } + + local desiredConfig = ... + local actualConfig = cartridge.config_get_readonly() + for key, _ in pairs(actualConfig) do + if not blacklist[key] then + if desiredConfig[key] == nil then + desiredConfig[key] = box.NULL + end + end + end + + return cartridge.config_patch_clusterwide(desiredConfig) +` + + var res bool + + err := r.Exec(ctx, leader, &res, lua, config) + if err != nil { + return errors.Wrap(err, "failed to upload cartridge config") + } + + if !res { + return fmt.Errorf("failed to upload cartridge config") + } + + return nil +} diff --git a/pkg/topology/errors.go b/pkg/topology/errors.go new file mode 100644 index 00000000..be5d4918 --- /dev/null +++ b/pkg/topology/errors.go @@ -0,0 +1,29 @@ +package topology + +import ( + "strings" + + "github.com/pkg/errors" +) + +var ( + ErrTopologyIsDown = errors.New("topology service is down") + ErrAlreadyJoined = errors.New("already joined") + ErrNotInConfig = errors.New("not in config") + ErrLastStorageWeight = errors.New("at least one vshard-storage (default) must have weight > 0") +) + +type UnknownRoleError struct { + *LuaError +} + +func NewUnknownRoleError(err *LuaError) *UnknownRoleError { + return &UnknownRoleError{ + LuaError: err, + } +} + +func isAlreadyBootstrapped(err *LuaError) bool { + return err.ClassName == "Bootstrapping vshard failed" && + strings.Contains(err.Err, "already bootstrapped") +} diff --git a/pkg/topology/request.go b/pkg/topology/request.go new file mode 100644 index 00000000..d380958f --- /dev/null +++ b/pkg/topology/request.go @@ -0,0 +1,62 @@ +package topology + +import "github.com/tarantool/tarantool-operator/pkg/api" + +type JoinServerParams struct { + URI string `json:"uri"` + UUID string `json:"uuid,omitempty"` +} + +type EditReplicasetParams struct { + UUID string `json:"uuid,omitempty"` + Alias string `json:"alias,omitempty"` + Roles []string `json:"roles,omitempty"` + AllRw bool `json:"all_rw,omitempty"` + Weight int32 `json:"weight,omitempty"` + FailoverPriority []string `json:"failover_priority,omitempty"` + VShardGroup string `json:"vshard_group,omitempty"` + JoinServers []JoinServerParams `json:"join_servers,omitempty"` +} + +type EditServerParams struct { + URI string `json:"uri,omitempty"` + UUID string `json:"uuid"` + Disabled bool `json:"disabled,omitempty"` + Expelled bool `json:"expelled,omitempty"` +} + +type EditTopologyParams struct { + Servers []EditServerParams `json:"servers,omitempty"` + Replicasets []EditReplicasetParams `json:"replicasets,omitempty"` +} + +type GetReplicasetsQuery struct { + UUID string `json:"uuid"` +} + +// FailoverParams type struct for configure failover. +type FailoverParams struct { + Mode api.FailoverMode `json:"mode"` + Timeout int32 `json:"failover_timeout,omitempty"` + StateProvider api.FailoverStateProvider `json:"state_provider,omitempty"` + FencingEnabled bool `json:"fencing_enabled,omitempty"` + FencingTimeout int32 `json:"fencing_timeout,omitempty"` + FencingPause int32 `json:"fencing_pause,omitempty"` + Etcd2Params *Etcd2Params `json:"etcd2_params,omitempty"` + StateboardParams *StateboardParams `json:"stateboard_params,omitempty"` +} + +// Etcd2Params type struct for configure etcd2 failover state provider. +type Etcd2Params struct { + Endpoints []string `json:"endpoints"` + Username string `json:"username"` + Password string `json:"password"` + LockDelay int32 `json:"lock_delay"` + Prefix string `json:"prefix"` +} + +// StateboardParams type struct for configure etcd2 failover state provider. +type StateboardParams struct { + URI string `json:"uri"` + Password string `json:"password"` +} diff --git a/pkg/topology/response.go b/pkg/topology/response.go new file mode 100644 index 00000000..980596c7 --- /dev/null +++ b/pkg/topology/response.go @@ -0,0 +1,29 @@ +package topology + +import ( + "fmt" +) + +type LuaCallResult[TRes any] struct { + Res TRes `json:"res,omitempty"` + Err *LuaError `json:"err,omitempty"` +} + +type LuaError struct { + Line int64 `json:"line"` + ClassName string `json:"class_name"` + Err string `json:"err"` + File string `json:"file"` + Stack string `json:"stack"` +} + +func (r *LuaError) Error() string { + return fmt.Sprintf("%s: %s", r.ClassName, r.Err) +} + +type ( + BooleanResult = LuaCallResult[bool] + Int64Result = LuaCallResult[int64] +) + +type CartridgeConfigData = map[string]interface{} diff --git a/pkg/topology/topology.go b/pkg/topology/topology.go new file mode 100644 index 00000000..1ff125f2 --- /dev/null +++ b/pkg/topology/topology.go @@ -0,0 +1,40 @@ +package topology + +import ( + "context" + + v1 "k8s.io/api/core/v1" +) + +// CartridgeTopology . +type CartridgeTopology interface { + Exec(ctx context.Context, instance *v1.Pod, res interface{}, lua string, args ...interface{}) error + + Join( + ctx context.Context, + leader *v1.Pod, + replicasetAlias string, + replicasetUUID string, + replicasetRoles []string, + replicasetWeight int32, + replicasetVshardGroup string, + replicasetIsAllRw bool, + advertiseURI string, + ) error + + GetInstanceUUID(ctx context.Context, pod *v1.Pod) (string, error) + + SetWeight(ctx context.Context, leader *v1.Pod, replicasetUUID string, replicaWeight int32) error + GetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string) ([]string, error) + SetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string, roles []string) error + + BootstrapVshard(ctx context.Context, leader *v1.Pod) error + + GetRolesHierarchy(ctx context.Context, leader *v1.Pod) (map[string][]string, error) + + SetFailoverParams(ctx context.Context, leader *v1.Pod, params *FailoverParams) error + GetFailoverParams(ctx context.Context, leader *v1.Pod) (*FailoverParams, error) + + GetCartridgeConfig(ctx context.Context, leader *v1.Pod) (CartridgeConfigData, error) + ApplyCartridgeConfig(ctx context.Context, leader *v1.Pod, config CartridgeConfigData) error +} diff --git a/pkg/topology/transport/podexec/cli/cli.go b/pkg/topology/transport/podexec/cli/cli.go new file mode 100644 index 00000000..7842b88a --- /dev/null +++ b/pkg/topology/transport/podexec/cli/cli.go @@ -0,0 +1,11 @@ +package cli + +type CLI interface { + CreateCommand(lua string, args ...any) (*Command, error) + Unmarshal(res string, target any) error +} + +type Command struct { + Command []string + StdIn string +} diff --git a/pkg/topology/transport/podexec/cli/tarantoolctl.go b/pkg/topology/transport/podexec/cli/tarantoolctl.go new file mode 100644 index 00000000..95944b28 --- /dev/null +++ b/pkg/topology/transport/podexec/cli/tarantoolctl.go @@ -0,0 +1,102 @@ +package cli + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "regexp" + "strings" + + "github.com/pkg/errors" + "gopkg.in/yaml.v3" +) + +type TarantoolCTLResult struct { + Ok bool `json:"ok"` + Hex string `json:"hex"` +} + +type TarantoolCTL struct{} + +func (*TarantoolCTL) CreateCommand(lua string, args ...any) (*Command, error) { + var safeLua string + + tpl := ` + local json = require('json') + local args = json.decode('%s') + local func = function(...) + %s + end + local ok, result + ok, result = pcall(func, unpack(args)) + return {ok=ok,hex=string.hex(json.encode(result)),} + ` + + if args != nil { + jsonArgs, err := json.Marshal(args) + if err != nil { + return nil, err + } + + safeLua = fmt.Sprintf(tpl, jsonArgs, lua) + } else { + safeLua = fmt.Sprintf(tpl, "{}", lua) + } + + safeLua = strings.ReplaceAll(safeLua, "\t", "") + + return &Command{ + Command: []string{ + "sh", + "-c", + "cat /dev/stdin | tarantoolctl connect `ls $CARTRIDGE_RUN_DIR/*.control` ", + }, + StdIn: safeLua, + }, nil +} + +func (*TarantoolCTL) Unmarshal(result string, target any) error { + var ( + leadingRe = regexp.MustCompile(`(?m)^---\n-\s+?`) + trailingRe = regexp.MustCompile(`(?m)\n.{3}\n?$`) + resultRe = regexp.MustCompile(`(?m)\n(\s*)hex:`) + ) + + result = leadingRe.ReplaceAllString(result, "") + result = trailingRe.ReplaceAllString(result, "") + result = resultRe.ReplaceAllString(result, "\nhex:") + + var hexRes *TarantoolCTLResult + + err := yaml.Unmarshal([]byte(result), &hexRes) + if err != nil { + return err + } + + if hexRes == nil { + return errors.New("can't parse tarantool output") + } + + bytesRes, err := hex.DecodeString(hexRes.Hex) + if err != nil { + return err + } + + if !hexRes.Ok { + var errMsg string + + err = json.Unmarshal(bytesRes, &errMsg) + if err != nil { + return err + } + + return errors.New(errMsg) + } + + err = json.Unmarshal(bytesRes, &target) + if err != nil { + return err + } + + return nil +} diff --git a/pkg/topology/transport/podexec/cli/tarantoolctl_test.go b/pkg/topology/transport/podexec/cli/tarantoolctl_test.go new file mode 100644 index 00000000..c602967a --- /dev/null +++ b/pkg/topology/transport/podexec/cli/tarantoolctl_test.go @@ -0,0 +1,79 @@ +package cli_test + +import ( + "strings" + "testing" + + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec/cli" + "github.com/tarantool/tarantool-operator/pkg/utils" +) + +type parseStringTestCase struct { + input string + expectedResult interface{} + err string +} + +func TestParseTarantoolOutputParseRoles(t *testing.T) { + tarantoolctl := &cli.TarantoolCTL{} + + cases := []parseStringTestCase{ + { + input: `--- +- ok: true + hex: 5b226661696c6f7665722d636f6f7264696e61746f72222c227673686172642d726f75746572222c226170702e726f6c65732e726f75746572225d +...`, + expectedResult: []string{"failover-coordinator", "vshard-router", "app.roles.router"}, + err: "", + }, + { + input: `--- +- ok: true + hex: 5B226661696C6F7665722D636F6F7264696E61746F72225D +...`, + expectedResult: []string{"failover-coordinator"}, + err: "", + }, + { + input: `--- +- ok: true + hex: 5B5D +...`, + expectedResult: []string{}, + err: "", + }, + { + input: `--- +- ok: true + hex: 226572726F7222 +...`, + expectedResult: []string{}, + err: "json: cannot unmarshal string into Go value of type []string", + }, + } + for i, c := range cases { + var result []string + err := tarantoolctl.Unmarshal(c.input, &result) + + if (err != nil || c.err != "") && !strings.Contains(err.Error(), c.err) { + t.Fatalf("%d: expected %s err, got: %s", i, c.err, err) + } + + expectedResult, ok := c.expectedResult.([]string) + if !ok { + t.Fatalf("Wrong expectedResult type") + } + + for _, v := range result { + if utils.SliceContains(expectedResult, v) == false { + t.Fatalf("%d: roles must not contains %s", i, v) + } + } + + for _, v := range expectedResult { + if utils.SliceContains(result, v) == false { + t.Fatalf("%d: roles must contains %s", i, v) + } + } + } +} diff --git a/pkg/topology/transport/podexec/transport.go b/pkg/topology/transport/podexec/transport.go new file mode 100644 index 00000000..a4afcc6b --- /dev/null +++ b/pkg/topology/transport/podexec/transport.go @@ -0,0 +1,108 @@ +package podexec + +import ( + "bytes" + "context" + "time" + + "github.com/tarantool/tarantool-operator/pkg/topology/transport/podexec/cli" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/remotecommand" +) + +const ( + resource = "pods" + subResource = "exec" + defaultTimeout = 2 * time.Second +) + +type PodExec struct { + RestClient rest.Interface + RestConfig *rest.Config + RuntimeScheme *runtime.Scheme + + CLI cli.CLI + + ContainerName string +} + +func (r *PodExec) Exec(ctx context.Context, pod *v1.Pod, res interface{}, lua string, args ...interface{}) error { + command, err := r.CLI.CreateCommand(lua, args...) + if err != nil { + return err + } + + stdout, err := r.execShellCommand(ctx, command, pod.GetName(), pod.GetNamespace()) + if err != nil { + return err + } + + return r.CLI.Unmarshal(stdout, &res) +} + +// execShellCommand +// TODO: use context here see: https://github.com/kubernetes/kubernetes/pull/107605 +func (r *PodExec) execShellCommand( + _ context.Context, + command *cli.Command, + podName string, + podNamespace string, +) (string, error) { + stdinExist := false + + if command.StdIn != "" { + stdinExist = true + } + + execCreateLua := r.RestClient. + Post(). + Namespace(podNamespace). + Resource(resource). + Name(podName). + SubResource(subResource). + Timeout(defaultTimeout). + MaxRetries(1). + VersionedParams( + &v1.PodExecOptions{ + Stdout: true, + Stdin: stdinExist, + Stderr: false, + TTY: false, + Command: command.Command, + Container: r.ContainerName, + }, + runtime.NewParameterCodec(r.RuntimeScheme), + ) + + exec, err := remotecommand.NewSPDYExecutor(r.RestConfig, "POST", execCreateLua.URL()) + if err != nil { + return "", err + } + + stdout := bytes.NewBufferString("") + + if stdinExist { + stdin := bytes.NewBufferString(command.StdIn) + err = exec.Stream(remotecommand.StreamOptions{ + Stdout: stdout, + Stdin: stdin, + Stderr: nil, + Tty: false, + }) + } else { + err = exec.Stream(remotecommand.StreamOptions{ + Stdout: stdout, + Stdin: nil, + Stderr: nil, + Tty: false, + }) + } + + if err != nil { + return "", err + } + + return stdout.String(), nil +} diff --git a/pkg/topology/transport/transport.go b/pkg/topology/transport/transport.go new file mode 100644 index 00000000..a4e48374 --- /dev/null +++ b/pkg/topology/transport/transport.go @@ -0,0 +1,11 @@ +package transport + +import ( + "context" + + v1 "k8s.io/api/core/v1" +) + +type Transport interface { + Exec(ctx context.Context, pod *v1.Pod, res any, lua string, args ...any) error +} diff --git a/pkg/utils/hash.go b/pkg/utils/hash.go new file mode 100644 index 00000000..071e4720 --- /dev/null +++ b/pkg/utils/hash.go @@ -0,0 +1,25 @@ +package utils + +import ( + "encoding/json" + "fmt" + "hash/fnv" + + "k8s.io/apimachinery/pkg/util/rand" +) + +func HashObject(data interface{}) (string, error) { + hashFunc := fnv.New32() + + jsonBytes, err := json.Marshal(data) + if err != nil { + return "", err + } + + _, err = hashFunc.Write(jsonBytes) + if err != nil { + return "", err + } + + return rand.SafeEncodeString(fmt.Sprint(hashFunc.Sum32())), nil +} diff --git a/pkg/utils/maps.go b/pkg/utils/maps.go new file mode 100644 index 00000000..4ef0d34d --- /dev/null +++ b/pkg/utils/maps.go @@ -0,0 +1,17 @@ +package utils + +func MergeMaps[KeyType comparable, ValueType any](ms ...map[KeyType]ValueType) map[KeyType]ValueType { + res := map[KeyType]ValueType{} + + for _, m := range ms { + if ms == nil { + continue + } + + for k, v := range m { + res[k] = v + } + } + + return res +} diff --git a/pkg/utils/pods.go b/pkg/utils/pods.go new file mode 100644 index 00000000..98276f11 --- /dev/null +++ b/pkg/utils/pods.go @@ -0,0 +1,72 @@ +package utils + +import v1 "k8s.io/api/core/v1" + +func IsPodDeleting(pod *v1.Pod) bool { + return pod.DeletionTimestamp != nil +} + +func IsPodRunning(pod *v1.Pod) bool { + return pod.Status.Phase == v1.PodRunning +} + +func IsPodDefaultContainerReady(pod *v1.Pod) bool { + if !IsPodRunning(pod) { + return false + } + + if pod.Status.ContainerStatuses == nil || len(pod.Status.ContainerStatuses) == 0 { + return false + } + + return pod.Status.ContainerStatuses[0].Ready +} + +// IsPodReady returns true if a pod is ready; false otherwise. +func IsPodReady(pod *v1.Pod) bool { + return IsPodReadyConditionTrue(pod.Status) +} + +// IsPodReadyConditionTrue returns true if a pod is ready; false otherwise. +func IsPodReadyConditionTrue(status v1.PodStatus) bool { + condition := GetPodReadyCondition(status) + + return condition != nil && condition.Status == v1.ConditionTrue +} + +// GetPodReadyCondition extracts the pod ready condition from the given status and returns that. +// Returns nil if the condition is not present. +func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition { + _, condition := GetPodCondition(&status, v1.PodReady) + + return condition +} + +// GetPodCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition) { + if status == nil { + return -1, nil + } + + return GetPodConditionFromList(status.Conditions, conditionType) +} + +// GetPodConditionFromList extracts the provided condition from the given list of condition and +// returns the index of the condition and the condition. Returns -1 and nil if the condition is not present. +func GetPodConditionFromList( + conditions []v1.PodCondition, + conditionType v1.PodConditionType, +) (int, *v1.PodCondition) { + if conditions == nil { + return -1, nil + } + + for i := range conditions { + if conditions[i].Type == conditionType { + return i, &conditions[i] + } + } + + return -1, nil +} diff --git a/pkg/utils/slice.go b/pkg/utils/slice.go new file mode 100644 index 00000000..21214739 --- /dev/null +++ b/pkg/utils/slice.go @@ -0,0 +1,11 @@ +package utils + +func SliceContains[Type comparable](a []Type, x Type) bool { + for _, n := range a { + if x == n { + return true + } + } + + return false +} diff --git a/pkg/utils/statefulsets.go b/pkg/utils/statefulsets.go new file mode 100644 index 00000000..97bcee91 --- /dev/null +++ b/pkg/utils/statefulsets.go @@ -0,0 +1,9 @@ +package utils + +import ( + "fmt" +) + +func GetStatefulSetPodName(stsName string, ordinal int32) string { + return fmt.Sprintf("%s-%d", stsName, ordinal) +} diff --git a/controllers/utils/suite_test.go b/pkg/utils/suite_test.go similarity index 74% rename from controllers/utils/suite_test.go rename to pkg/utils/suite_test.go index dbaf2926..4dc61562 100644 --- a/controllers/utils/suite_test.go +++ b/pkg/utils/suite_test.go @@ -1,13 +1,13 @@ -package utils +package utils_test import ( + "testing" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - - "testing" ) func TestControllerUtils(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Controller utils Suite") + RunSpecs(t, "pkg utils suite") } diff --git a/pkg/utils/vshard.go b/pkg/utils/vshard.go new file mode 100644 index 00000000..66bebe8c --- /dev/null +++ b/pkg/utils/vshard.go @@ -0,0 +1,21 @@ +package utils + +import "github.com/google/go-cmp/cmp" + +func IsVShardRolesEquals(rolesA, rolesB []string, hierarchy map[string][]string) bool { + return cmp.Equal(VShardRolesToMap(rolesA, hierarchy), VShardRolesToMap(rolesB, hierarchy)) +} + +func VShardRolesToMap(roles []string, hierarchy map[string][]string) map[string]bool { + rmap := make(map[string]bool) + + for _, role := range roles { + rmap[role] = true + + for _, dep := range hierarchy[role] { + rmap[dep] = true + } + } + + return rmap +} diff --git a/pkg/utils/vshard_test.go b/pkg/utils/vshard_test.go new file mode 100644 index 00000000..8a86f09b --- /dev/null +++ b/pkg/utils/vshard_test.go @@ -0,0 +1,118 @@ +package utils_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/gomega" + "github.com/tarantool/tarantool-operator/pkg/utils" +) + +var _ = Describe("role utils unit testing", func() { + Describe(`IsVShardRolesEquals function must compare two arrays of roles for equality, respecting the hierarchy and regardless of the order of the elements`, + func() { + Context("positive cases (equal arrays)", func() { + DescribeTable( + "should regard order if roles are same", + func(a, b []string) { + hierarchy := map[string][]string{ + "A": {}, + "B": {}, + "C": {}, + } + Expect(utils.IsVShardRolesEquals(a, b, hierarchy)).Should(BeTrue()) + Expect(utils.IsVShardRolesEquals(b, a, hierarchy)).Should(BeTrue()) + }, + Entry("Empty and empty", []string{}, []string{}), + Entry("A and A", []string{"A"}, []string{"A"}), + Entry("A-B-C and A-B-C", []string{"A", "B", "C"}, []string{"A", "B", "C"}), + Entry("A-B-C and A-C-B", []string{"A", "B", "C"}, []string{"A", "C", "B"}), + Entry("A-B-C and B-A-C", []string{"A", "B", "C"}, []string{"B", "A", "C"}), + Entry("A-B-C and B-C-A", []string{"A", "B", "C"}, []string{"B", "C", "A"}), + Entry("A-B-C and C-A-B", []string{"A", "B", "C"}, []string{"C", "A", "B"}), + Entry("A-B-C and C-B-A", []string{"A", "B", "C"}, []string{"C", "B", "A"}), + Entry("A-C-B and A-B-C", []string{"A", "C", "B"}, []string{"A", "B", "C"}), + Entry("A-C-B and A-C-B", []string{"A", "C", "B"}, []string{"A", "C", "B"}), + Entry("A-C-B and B-A-C", []string{"A", "C", "B"}, []string{"B", "A", "C"}), + Entry("A-C-B and B-C-A", []string{"A", "C", "B"}, []string{"B", "C", "A"}), + Entry("A-C-B and C-A-B", []string{"A", "C", "B"}, []string{"C", "A", "B"}), + Entry("A-C-B and C-B-A", []string{"A", "C", "B"}, []string{"C", "B", "A"}), + Entry("B-A-C and A-B-C", []string{"B", "A", "C"}, []string{"A", "B", "C"}), + Entry("B-A-C and A-C-B", []string{"B", "A", "C"}, []string{"A", "C", "B"}), + Entry("B-A-C and B-A-C", []string{"B", "A", "C"}, []string{"B", "A", "C"}), + Entry("B-A-C and B-C-A", []string{"B", "A", "C"}, []string{"B", "C", "A"}), + Entry("B-A-C and C-A-B", []string{"B", "A", "C"}, []string{"C", "A", "B"}), + Entry("B-A-C and C-B-A", []string{"B", "A", "C"}, []string{"C", "B", "A"}), + Entry("B-C-A and A-B-C", []string{"B", "C", "A"}, []string{"A", "B", "C"}), + Entry("B-C-A and A-C-B", []string{"B", "C", "A"}, []string{"A", "C", "B"}), + Entry("B-C-A and B-A-C", []string{"B", "C", "A"}, []string{"B", "A", "C"}), + Entry("B-C-A and B-C-A", []string{"B", "C", "A"}, []string{"B", "C", "A"}), + Entry("B-C-A and C-A-B", []string{"B", "C", "A"}, []string{"C", "A", "B"}), + Entry("B-C-A and C-B-A", []string{"B", "C", "A"}, []string{"C", "B", "A"}), + Entry("C-A-B and A-B-C", []string{"C", "A", "B"}, []string{"A", "B", "C"}), + Entry("C-A-B and A-C-B", []string{"C", "A", "B"}, []string{"A", "C", "B"}), + Entry("C-A-B and B-A-C", []string{"C", "A", "B"}, []string{"B", "A", "C"}), + Entry("C-A-B and B-C-A", []string{"C", "A", "B"}, []string{"B", "C", "A"}), + Entry("C-A-B and C-A-B", []string{"C", "A", "B"}, []string{"C", "A", "B"}), + Entry("C-A-B and C-B-A", []string{"C", "A", "B"}, []string{"C", "B", "A"}), + Entry("C-B-A and A-B-C", []string{"C", "B", "A"}, []string{"A", "B", "C"}), + Entry("C-B-A and A-C-B", []string{"C", "B", "A"}, []string{"A", "C", "B"}), + Entry("C-B-A and B-A-C", []string{"C", "B", "A"}, []string{"B", "A", "C"}), + Entry("C-B-A and B-C-A", []string{"C", "B", "A"}, []string{"B", "C", "A"}), + Entry("C-B-A and C-A-B", []string{"C", "B", "A"}, []string{"C", "A", "B"}), + Entry("C-B-A and C-B-A", []string{"C", "B", "A"}, []string{"C", "B", "A"}), + ) + DescribeTable( + "Should respect roles hierarchy, roles can be skipped in array if parent role in array", + func(a, b []string) { + hierarchy := map[string][]string{ + "A": {"A1"}, + "B": {"B1"}, + "C": {"C1", "C2"}, + } + Expect(utils.IsVShardRolesEquals(a, b, hierarchy)).Should(BeTrue()) + Expect(utils.IsVShardRolesEquals(b, a, hierarchy)).Should(BeTrue()) + }, + Entry("Simple example A", []string{"A", "A1"}, []string{"A"}), + Entry("Simple example B", []string{"B", "B1"}, []string{"B"}), + Entry("Simple example C", []string{"C", "C1", "C2"}, []string{"C"}), + Entry("A and B", []string{"A", "B"}, []string{"A", "A1", "B", "B1"}), + Entry("B and C", []string{"B", "C", "C1", "C2"}, []string{"B", "B1", "C"}), + Entry("A and B rand order", []string{"B", "A"}, []string{"B1", "A", "B", "A1"}), + ) + }) + + Context("negative cases (unequal arrays)", func() { + DescribeTable("should return false array doe not match", + func(a, b []string) { + hierarchy := map[string][]string{ + "A": {}, + "B": {}, + "C": {}, + } + + Expect(utils.IsVShardRolesEquals(a, b, hierarchy)).Should(BeFalse()) + Expect(utils.IsVShardRolesEquals(b, a, hierarchy)).Should(BeFalse()) + }, + Entry("A and empty", []string{"A"}, []string{}), + Entry("A and B", []string{"A"}, []string{"B"}), + Entry("A-B and B", []string{"A", "B"}, []string{"B"}), + Entry("A-B and C-A", []string{"A", "B"}, []string{"C", "A"}), + ) + + DescribeTable("all child roles != parent role", + func(a, b []string) { + hierarchy := map[string][]string{ + "A": {"A1"}, + "B": {"B1"}, + "C": {"C1", "C2"}, + } + + Expect(utils.IsVShardRolesEquals(a, b, hierarchy)).Should(BeFalse()) + Expect(utils.IsVShardRolesEquals(b, a, hierarchy)).Should(BeFalse()) + }, + Entry("A-B-B1 and B-B1-A1", []string{"B", "B1"}, []string{"B", "B1", "A"}), + Entry("C1-C2 and C", []string{"C1", "C2"}, []string{"C"}), + ) + }) + }) +}) diff --git a/test/helpers/ci/cluster_values.yaml b/test/helpers/ci/cluster_values.yaml deleted file mode 100644 index 6555d242..00000000 --- a/test/helpers/ci/cluster_values.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Declare variables to be passed into your templates. - -ClusterEnv: dev -LuaMemoryReserveMB: 0 - -RoleConfig: - - RoleName: router - ReplicaCount: 1 - ReplicaSetCount: 1 - DiskSize: 0.2Gi - CPUallocation: 0.25 - MemtxMemoryMB: 128 - RolesToAssign: - - router - - - RoleName: storage - ReplicaCount: 1 - ReplicaSetCount: 1 - DiskSize: 0.2Gi - CPUallocation: 0.25 - MemtxMemoryMB: 128 - RolesToAssign: - - storage diff --git a/test/helpers/resource_factory.go b/test/helpers/resource_factory.go deleted file mode 100644 index 87948d2b..00000000 --- a/test/helpers/resource_factory.go +++ /dev/null @@ -1,372 +0,0 @@ -package helpers - -import ( - "fmt" - - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - tarantooliov1alpha1 "github.com/tarantool/tarantool-operator/api/v1alpha1" - - "k8s.io/apimachinery/pkg/api/resource" -) - -type ClusterParams struct { - Name string - Namespace string - Id string -} - -type RoleParams struct { - Name string - Namespace string - ClusterId string - RolesToAssign string - RsNum int32 - RsTemplateName string -} - -type ReplicasetTemplateParams struct { - Name string - Namespace string - ClusterId string - RoleName string - RolesToAssign string - PodTemplateName string - ContainerName string - ContainerImage string - ServiceName string - EnvVars map[string]string - ReplicasNum int32 -} - -type ServiceParams struct { - Name string - Namespace string - RoleName string -} - -type CartridgeParams struct { - Namespace string - ClusterName string - ClusterID string -} - -type Cartridge struct { - Cluster *tarantooliov1alpha1.Cluster - Roles []*tarantooliov1alpha1.Role - ReplicasetTemplates []*tarantooliov1alpha1.ReplicasetTemplate - Services []*corev1.Service -} - -func NewCartridge(params CartridgeParams) *Cartridge { - namespace := params.Namespace - clusterName := params.ClusterName - clusterId := params.ClusterID - - cluster := NewCluster(ClusterParams{ - Namespace: namespace, - Name: clusterName, - Id: clusterId, - }) - - routerRole := NewRole(RoleParams{ - Name: "router", - Namespace: namespace, - ClusterId: clusterId, - RolesToAssign: "[\"failover-coordinator\",\"app.roles.router\"]", - RsNum: 1, - RsTemplateName: "router-template", - }) - routerRs := NewReplicasetTemplate(ReplicasetTemplateParams{ - Name: "router-template", - Namespace: namespace, - ClusterId: clusterId, - RoleName: "router", - RolesToAssign: "[\"failover-coordinator\",\"app.roles.router\"]", - PodTemplateName: "router-template", - ContainerName: "pim-storage", - ContainerImage: "tarantool/tarantool-operator-examples-kv:0.0.4", - ServiceName: "router", - ReplicasNum: 1, - }) - routerSvc := NewService(ServiceParams{ - Name: "router", - Namespace: namespace, - RoleName: "router", - }) - - storageRole := NewRole(RoleParams{ - Name: "storage", - Namespace: namespace, - ClusterId: clusterId, - RolesToAssign: "[\"app.roles.storage\"]", - RsNum: 1, - RsTemplateName: "storage-template", - }) - storageRs := NewReplicasetTemplate(ReplicasetTemplateParams{ - Name: "storage-template", - Namespace: namespace, - ClusterId: clusterId, - RoleName: "storage", - RolesToAssign: "[\"app.roles.storage\"]", - PodTemplateName: "storage-template", - ContainerName: "pim-storage", - ContainerImage: "tarantool/tarantool-operator-examples-kv:0.0.4", - ServiceName: "storage", - ReplicasNum: 3, - }) - storageSvc := NewService(ServiceParams{ - Name: "storage", - Namespace: namespace, - RoleName: "storage", - }) - - return &Cartridge{ - Cluster: &cluster, - Roles: []*tarantooliov1alpha1.Role{ - &routerRole, - &storageRole, - }, - ReplicasetTemplates: []*tarantooliov1alpha1.ReplicasetTemplate{ - &routerRs, - &storageRs, - }, - Services: []*corev1.Service{ - &routerSvc, - &storageSvc, - }, - } -} - -// Create new tarantooliov1alpha1.Cluster -func NewCluster(params ClusterParams) tarantooliov1alpha1.Cluster { - return tarantooliov1alpha1.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: params.Name, - Namespace: params.Namespace, - }, - Spec: tarantooliov1alpha1.ClusterSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "tarantool.io/cluster-id": params.Id, - }, - }, - }, - } -} - -// Create new tarantooliov1alpha1.Role -func NewRole(params RoleParams) tarantooliov1alpha1.Role { - return tarantooliov1alpha1.Role{ - ObjectMeta: metav1.ObjectMeta{ - Name: params.Name, - Namespace: params.Namespace, - Labels: map[string]string{ - "tarantool.io/cluster-id": params.ClusterId, - "tarantool.io/role": params.Name, - }, - Annotations: map[string]string{ - "tarantool.io/rolesToAssign": params.RolesToAssign, - }, - }, - Spec: tarantooliov1alpha1.RoleSpec{ - NumReplicasets: ¶ms.RsNum, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "tarantool.io/replicaset-template": params.RsTemplateName, - }, - }, - }, - } -} - -// Create new tarantooliov1alpha1.ReplicasetTemplate -func NewReplicasetTemplate(params ReplicasetTemplateParams) tarantooliov1alpha1.ReplicasetTemplate { - var ( - replicasNum = int32(1) - alias = fmt.Sprintf("%s-%d-%d", params.RoleName, 0, 0) - advHost = fmt.Sprintf("%s.%s.%s.svc.cluster.local", alias, params.ClusterId, params.Namespace) - advUri = fmt.Sprintf("%s:3301", advHost) - ) - - envs := map[string]string{ - "ENVIRONMENT": "dev", - "TARANTOOL_INSTANCE_NAME": alias, - "TARANTOOL_ALIAS": alias, - "TARANTOOL_MEMTX_MEMORY": "268435456", - "TARANTOOL_BUCKET_COUNT": "30000", - "TARANTOOL_WORKDIR": "/var/lib/tarantool", - "TARANTOOL_ADVERTISE_TMP": alias, - "TARANTOOL_ADVERTISE_HOST": advHost, - "TARANTOOL_ADVERTISE_URI": advUri, - "TARANTOOL_PROBE_URI_TIMEOUT": "60", - "TARANTOOL_HTTP_PORT": "8081", - } - - for name, val := range params.EnvVars { - envs[name] = val - } - - vars := []corev1.EnvVar{} - for name, val := range envs { - vars = append(vars, corev1.EnvVar{Name: name, Value: val}) - } - - return tarantooliov1alpha1.ReplicasetTemplate{ - ObjectMeta: metav1.ObjectMeta{ - Name: params.Name, - Namespace: params.Namespace, - Labels: map[string]string{ - "tarantool.io/cluster-id": params.ClusterId, - "tarantool.io/replicaset-template": params.Name, - "tarantool.io/role": params.RoleName, - "tarantool.io/useVshardGroups": "0", - }, - Annotations: map[string]string{ - "tarantool.io/rolesToAssign": params.RolesToAssign, - }, - }, - Spec: &appsv1.StatefulSetSpec{ - Replicas: &replicasNum, - ServiceName: params.ServiceName, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "tarantool.io/pod-template": params.PodTemplateName, - }, - }, - VolumeClaimTemplates: []corev1.PersistentVolumeClaim{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "www", - }, - Spec: corev1.PersistentVolumeClaimSpec{ - AccessModes: []corev1.PersistentVolumeAccessMode{ - corev1.ReadWriteOnce, - }, - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - "storage": *resource.NewQuantity(1*1024*1024*1024, resource.BinarySI), - }, - }, - }, - }, - }, - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "tarantool.io/cluster-id": params.ClusterId, - "tarantool.io/cluster-domain-name": "cluster.local", - "tarantool.io/pod-template": params.PodTemplateName, - "tarantool.io/useVshardGroups": "0", - "environment": "dev", - }, - Annotations: map[string]string{ - "tarantool.io/rolesToAssign": params.RolesToAssign, - }, - }, - Spec: corev1.PodSpec{ - // TerminationGracePeriodSeconds: &terminationGracePeriod, - // DNSConfig: &corev1.PodDNSConfig{ - // Options: []corev1.PodDNSConfigOption{ - // { - // Name: "ndots", - // Value: &dnsOptionsValue, - // }, - // }, - // }, - // SecurityContext: &corev1.PodSecurityContext{ - // FSGroup: &fsGroup, - // }, - Containers: []corev1.Container{ - { - Name: params.ContainerName, - Image: params.ContainerImage, - VolumeMounts: []corev1.VolumeMount{ - { - Name: "www", - MountPath: "/var/lib/tarantool", - }, - }, - // SecurityContext: &corev1.SecurityContext{ - // Capabilities: &corev1.Capabilities{ - // Add: []corev1.Capability{ - // "SYS_ADMIN", - // }, - // }, - // }, - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - "cpu": *resource.NewMilliQuantity(1000, resource.DecimalSI), - "memory": *resource.NewQuantity(256*1024*1024, resource.BinarySI), - }, - }, - Ports: []corev1.ContainerPort{ - { - Name: "app", - Protocol: corev1.ProtocolTCP, - ContainerPort: int32(3301), - }, - { - Name: "app-udp", - Protocol: corev1.ProtocolUDP, - ContainerPort: int32(3301), - }, - { - Name: "http", - Protocol: corev1.ProtocolTCP, - ContainerPort: int32(8081), - }, - }, - Env: vars, - // ReadinessProbe: &corev1.Probe{ - // Handler: corev1.Handler{ - // TCPSocket: &corev1.TCPSocketAction{ - // Port: intstr.IntOrString{ - // Type: intstr.String, - // StrVal: "http", - // }, - // }, - // }, - // InitialDelaySeconds: int32(15), - // PeriodSeconds: int32(10), - // }, - }, - }, - }, - }, - }, - } -} - -// Create new corev1.Service to access instances of specific Tarantool role -func NewService(params ServiceParams) corev1.Service { - return corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: params.Name, - Namespace: params.Namespace, - Labels: map[string]string{ - "tarantool.io/role": params.RoleName, - }, - }, - - Spec: corev1.ServiceSpec{ - Ports: []corev1.ServicePort{ - { - Name: "web", - Protocol: corev1.ProtocolTCP, - Port: int32(8081), - }, - { - Name: "app", - Protocol: corev1.ProtocolTCP, - Port: int32(3301), - }, - }, - Selector: map[string]string{ - "tarantool.io/role": params.RoleName, - }, - }, - } -} diff --git a/test/mocks/topology.go b/test/mocks/topology.go new file mode 100644 index 00000000..df976286 --- /dev/null +++ b/test/mocks/topology.go @@ -0,0 +1,107 @@ +package mocks + +import ( + "context" + + "github.com/stretchr/testify/mock" + "github.com/tarantool/tarantool-operator/pkg/topology" + "k8s.io/api/core/v1" +) + +type FakeCartridgeTopology struct { + mock.Mock +} + +func (f *FakeCartridgeTopology) Exec(ctx context.Context, instance *v1.Pod, res interface{}, lua string, args ...interface{}) error { + callArgs := []interface{}{ctx, instance, res, lua} + callArgs = append(callArgs, args...) + called := f.Called(callArgs...) + + return called.Error(0) +} + +func (f *FakeCartridgeTopology) Join( + ctx context.Context, + leader *v1.Pod, + replicasetAlias string, + replicasetUUID string, + replicasetRoles []string, + replicasetWeight int32, + replicasetVshardGroup string, + replicasetIsAllRw bool, + advertiseURI string, +) error { + args := f.Called( + ctx, + leader, + replicasetAlias, + replicasetUUID, + replicasetRoles, + replicasetWeight, + replicasetVshardGroup, + replicasetIsAllRw, + advertiseURI, + ) + + return args.Error(0) +} + +func (f *FakeCartridgeTopology) GetInstanceUUID(ctx context.Context, pod *v1.Pod) (string, error) { + args := f.Called(ctx, pod) + + return args.String(0), args.Error(1) +} + +func (f *FakeCartridgeTopology) SetWeight(ctx context.Context, leader *v1.Pod, replicasetUUID string, replicaWeight int32) error { + args := f.Called(ctx, leader, replicasetUUID, replicaWeight) + + return args.Error(0) +} + +func (f *FakeCartridgeTopology) GetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string) ([]string, error) { + args := f.Called(ctx, leader, replicasetUUID) + + return args.Get(0).([]string), args.Error(1) +} + +func (f *FakeCartridgeTopology) SetReplicasetRoles(ctx context.Context, leader *v1.Pod, replicasetUUID string, roles []string) error { + args := f.Called(ctx, leader, replicasetUUID, roles) + + return args.Error(0) +} + +func (f *FakeCartridgeTopology) BootstrapVshard(ctx context.Context, leader *v1.Pod) error { + args := f.Called(ctx, leader) + + return args.Error(0) +} + +func (f *FakeCartridgeTopology) GetRolesHierarchy(ctx context.Context, leader *v1.Pod) (map[string][]string, error) { + args := f.Called(ctx, leader) + + return args.Get(0).(map[string][]string), args.Error(1) +} + +func (f *FakeCartridgeTopology) SetFailoverParams(ctx context.Context, leader *v1.Pod, params *topology.FailoverParams) error { + args := f.Called(ctx, leader, params) + + return args.Error(0) +} + +func (f *FakeCartridgeTopology) GetFailoverParams(ctx context.Context, leader *v1.Pod) (*topology.FailoverParams, error) { + args := f.Called(ctx, leader) + + return args.Get(0).(*topology.FailoverParams), args.Error(1) +} + +func (f *FakeCartridgeTopology) GetCartridgeConfig(ctx context.Context, leader *v1.Pod) (topology.CartridgeConfigData, error) { + args := f.Called(ctx, leader) + + return args.Get(0).(topology.CartridgeConfigData), args.Error(1) +} + +func (f *FakeCartridgeTopology) ApplyCartridgeConfig(ctx context.Context, leader *v1.Pod, config topology.CartridgeConfigData) error { + args := f.Called(ctx, leader, config) + + return args.Error(0) +} diff --git a/test/resources/cartridge.go b/test/resources/cartridge.go new file mode 100644 index 00000000..562857ff --- /dev/null +++ b/test/resources/cartridge.go @@ -0,0 +1,67 @@ +package resources + +import ( + "github.com/tarantool/tarantool-operator/apis/v1beta1" + "github.com/tarantool/tarantool-operator/pkg/k8s" + appsv1 "k8s.io/api/apps/v1" + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" +) + +func NewFakeCartridge(labelsManager k8s.LabelsManager) *FakeCartridge { + cluster := &v1beta1.Cluster{ + ObjectMeta: metav1.ObjectMeta{}, + Spec: v1beta1.ClusterSpec{ + Domain: DefaultDomain, + ListenPort: DefaultListenPort, + }, + Status: v1beta1.ClusterStatus{ + Phase: v1beta1.ClusterPending, + Leader: "", + Bootstrapped: false, + }, + } + + builder := &FakeCartridge{ + labelsManager: labelsManager, + Cluster: cluster, + Roles: map[string]*v1beta1.Role{}, + StatefulSets: map[string]map[string]*appsv1.StatefulSet{}, + objects: []client.Object{ + cluster, + }, + } + + return builder +} + +type FakeCartridge struct { + labelsManager k8s.LabelsManager + + Cluster *v1beta1.Cluster + Roles map[string]*v1beta1.Role + StatefulSets map[string]map[string]*appsv1.StatefulSet + Pods []*v1.Pod + + objects []client.Object +} + +func (r *FakeCartridge) object(obj client.Object) { + r.objects = append(r.objects, obj) +} + +func (r *FakeCartridge) WithNamespace(namespace string) *FakeCartridge { + r.Cluster.Namespace = namespace + + return r +} + +func (r *FakeCartridge) BuildFakeClient() client.WithWatch { + fakeClientBuilder := fake.NewClientBuilder() + + return fakeClientBuilder. + WithObjects(r.objects...). + Build() +} diff --git a/test/resources/cluster.go b/test/resources/cluster.go new file mode 100644 index 00000000..edc47a56 --- /dev/null +++ b/test/resources/cluster.go @@ -0,0 +1,13 @@ +package resources + +func (r *FakeCartridge) WithClusterName(name string) *FakeCartridge { + r.Cluster.Name = name + + return r +} + +func (r *FakeCartridge) Bootstrapped() *FakeCartridge { + r.Cluster.Status.Bootstrapped = true + + return r +} diff --git a/test/resources/constants.go b/test/resources/constants.go new file mode 100644 index 00000000..cabb9135 --- /dev/null +++ b/test/resources/constants.go @@ -0,0 +1,25 @@ +package resources + +const ( + FakeDockerImageV1 = "fake/cartridge:1.0.0" + FakeDockerImageV2 = "fake/cartridge:2.0.0" +) + +const PodContainerName = "cartridge" + +const ( + DefaultCpuLimit = 1000 + DefaultMemoryLimit = 256 * 1024 * 1024 + DefaultStorageLimit = 1 * 1024 * 1024 * 1024 +) + +const ( + DefaultDomain = "Cluster.local" + DefaultListenPort = 3301 + ConstDefaultReplicasetWeight = 100 +) + +const ( + RoleRouter = "router" + RoleStorage = "storage" +) diff --git a/test/resources/container.go b/test/resources/container.go new file mode 100644 index 00000000..275b9a67 --- /dev/null +++ b/test/resources/container.go @@ -0,0 +1,37 @@ +package resources + +import ( + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" +) + +func (r *FakeCartridge) NewCartridgeContainer() v1.Container { + return v1.Container{ + Name: PodContainerName, + Image: FakeDockerImageV1, + VolumeMounts: []v1.VolumeMount{ + { + Name: "data", + MountPath: "/var/lib/tarantool", + }, + }, + Resources: v1.ResourceRequirements{ + Limits: v1.ResourceList{ + "cpu": *resource.NewMilliQuantity(DefaultCpuLimit, resource.DecimalSI), + "memory": *resource.NewQuantity(DefaultMemoryLimit, resource.BinarySI), + }, + }, + Ports: []v1.ContainerPort{ + { + Name: "app", + Protocol: v1.ProtocolTCP, + ContainerPort: r.Cluster.GetListenPort(), + }, + { + Name: "app-udp", + Protocol: v1.ProtocolUDP, + ContainerPort: r.Cluster.GetListenPort(), + }, + }, + } +} diff --git a/test/resources/pod.go b/test/resources/pod.go new file mode 100644 index 00000000..5e381cf3 --- /dev/null +++ b/test/resources/pod.go @@ -0,0 +1,92 @@ +package resources + +import ( + "fmt" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (r *FakeCartridge) WithPodsCreated(roleName string) *FakeCartridge { + cluster := r.Cluster + + role, ok := r.Roles[roleName] + if !ok { + panic(fmt.Errorf("role %s not added to fake cartridge", roleName)) + } + + statefulSets, ok := r.StatefulSets[roleName] + if !ok { + panic(fmt.Errorf("stateful sets for role %s not added to fake cartridge", roleName)) + } + + for _, sts := range statefulSets { + for podNum := int32(0); podNum < *sts.Spec.Replicas; podNum++ { + pod := &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("%s-%d", sts.Name, podNum), + Namespace: sts.Namespace, + Labels: map[string]string{ + r.labelsManager.ClusterName(): cluster.Name, + r.labelsManager.RoleName(): role.Name, + }, + }, + Status: v1.PodStatus{ + Phase: v1.PodPending, + }, + } + r.Pods = append(r.Pods, pod) + r.object(pod) + } + } + + return r +} + +func (r *FakeCartridge) WithRouterPodsCreated() *FakeCartridge { + return r.WithPodsCreated(RoleRouter) +} + +func (r *FakeCartridge) WithStoragePodsCreated() *FakeCartridge { + return r.WithPodsCreated(RoleStorage) +} + +func (r *FakeCartridge) WithAllPodsReady() *FakeCartridge { + for _, pod := range r.Pods { + r.setPodReady(pod) + r.setPodContainerReady(pod, PodContainerName) + } + + return r +} + +func (r *FakeCartridge) setPodReady(pod *v1.Pod) { + if pod.Status.Conditions == nil { + pod.Status.Conditions = []v1.PodCondition{} + } + + pod.Status.Phase = v1.PodRunning + pod.Status.Conditions = append(pod.Status.Conditions, v1.PodCondition{ + Type: v1.PodReady, + Status: v1.ConditionTrue, + Reason: "Ready", + Message: "Ready", + }) +} + +func (r *FakeCartridge) setPodContainerReady(pod *v1.Pod, containerName string) { + if pod.Status.ContainerStatuses == nil { + pod.Status.ContainerStatuses = []v1.ContainerStatus{} + } + + started := true + + pod.Status.ContainerStatuses = append( + pod.Status.ContainerStatuses, + v1.ContainerStatus{ + Name: containerName, + Ready: true, + Started: &started, + }, + ) +} diff --git a/test/resources/role.go b/test/resources/role.go new file mode 100644 index 00000000..41dd457c --- /dev/null +++ b/test/resources/role.go @@ -0,0 +1,62 @@ +package resources + +import ( + "github.com/tarantool/tarantool-operator/apis/v1beta1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (r *FakeCartridge) WithRole(name string, replicasets, replicas int32) *FakeCartridge { + cluster := r.Cluster + r.Roles[name] = &v1beta1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: cluster.GetNamespace(), + Labels: map[string]string{ + r.labelsManager.ClusterName(): cluster.GetName(), + r.labelsManager.RoleName(): name, + }, + }, + Spec: v1beta1.RoleSpec{ + Replicasets: &replicasets, + VShard: v1beta1.RoleVShardConfig{ + Weight: ConstDefaultReplicasetWeight, + }, + ReplicasetTemplate: &v1beta1.ReplicasetTemplate{ + Replicas: &replicas, + VolumeClaimTemplates: []v1.PersistentVolumeClaim{}, + PodTemplate: v1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + r.labelsManager.ClusterName(): cluster.GetName(), + }, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + r.NewCartridgeContainer(), + }, + }, + }, + }, + }, + } + r.object(r.Roles[name]) + + return r +} + +func (r *FakeCartridge) WithRouterRole(replicasets, replicas int32) *FakeCartridge { + return r.WithRole(RoleRouter, replicasets, replicas) +} + +func (r *FakeCartridge) WithStorageRole(replicasets, replicas int32) *FakeCartridge { + return r.WithRole(RoleStorage, replicasets, replicas) +} + +func (r *FakeCartridge) WithAllRolesInPhase(phase v1beta1.RolePhase) *FakeCartridge { + for _, role := range r.Roles { + role.Status.Phase = phase + } + + return r +} diff --git a/test/resources/sts.go b/test/resources/sts.go new file mode 100644 index 00000000..01828ed2 --- /dev/null +++ b/test/resources/sts.go @@ -0,0 +1,49 @@ +package resources + +import ( + "fmt" + + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (r *FakeCartridge) WithStatefulSetsCreated(roleName string) *FakeCartridge { + cluster := r.Cluster + + role, ok := r.Roles[roleName] + if !ok { + panic(fmt.Errorf("role %s not added to fake cartridge", roleName)) + } + + r.StatefulSets[roleName] = map[string]*appsv1.StatefulSet{} + + for stsNum := int32(0); stsNum < *role.Spec.Replicasets; stsNum++ { + stsName := fmt.Sprintf("%s-%d", role.Name, stsNum) + r.StatefulSets[roleName][stsName] = &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: stsName, + Namespace: cluster.Namespace, + Labels: map[string]string{ + r.labelsManager.ClusterName(): cluster.Name, + }, + }, + Spec: appsv1.StatefulSetSpec{ + Replicas: role.Spec.ReplicasetTemplate.Replicas, + Template: role.Spec.ReplicasetTemplate.PodTemplate, + VolumeClaimTemplates: role.Spec.ReplicasetTemplate.VolumeClaimTemplates, + }, + Status: appsv1.StatefulSetStatus{}, + } + r.object(r.StatefulSets[roleName][stsName]) + } + + return r +} + +func (r *FakeCartridge) WithRouterStatefulSetsCreated() *FakeCartridge { + return r.WithStatefulSetsCreated(RoleRouter) +} + +func (r *FakeCartridge) WithStorageStatefulSetsCreated() *FakeCartridge { + return r.WithStatefulSetsCreated(RoleStorage) +} diff --git a/test/resources/volume_claim.go b/test/resources/volume_claim.go new file mode 100644 index 00000000..1bc70974 --- /dev/null +++ b/test/resources/volume_claim.go @@ -0,0 +1,25 @@ +package resources + +import ( + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (r *FakeCartridge) NewDataVolumeClaim() v1.PersistentVolumeClaim { + return v1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "data", + }, + Spec: v1.PersistentVolumeClaimSpec{ + AccessModes: []v1.PersistentVolumeAccessMode{ + v1.ReadWriteOnce, + }, + Resources: v1.ResourceRequirements{ + Requests: v1.ResourceList{ + "storage": *resource.NewQuantity(DefaultStorageLimit, resource.BinarySI), + }, + }, + }, + } +} diff --git a/test/utils/rand.go b/test/utils/rand.go new file mode 100644 index 00000000..b8d8d657 --- /dev/null +++ b/test/utils/rand.go @@ -0,0 +1,14 @@ +package utils + +import "math/rand" + +var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz") + +func RandStringRunes(n int) string { + b := make([]rune, n) + for i := range b { + b[i] = letterRunes[rand.Intn(len(letterRunes))] + } + + return string(b) +} diff --git a/test/utils/reconciliation.go b/test/utils/reconciliation.go new file mode 100644 index 00000000..19c5609b --- /dev/null +++ b/test/utils/reconciliation.go @@ -0,0 +1,15 @@ +package utils + +import ( + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" +) + +func ReconcileRequest(namespace, name string) ctrl.Request { + return ctrl.Request{ + NamespacedName: types.NamespacedName{ + Namespace: namespace, + Name: name, + }, + } +}